Skip to content

This package offers a convenient solution for Laravel developers who need to include a dropdown menu of timezones in their applications

License

Notifications You must be signed in to change notification settings

Baspa/laravel-timezones

Repository files navigation

Banner

Laravel package to generate arrays of available timezones to be used in lists.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

The Laravel Timezones package is a convenient solution for Laravel developers who need to include a dropdown menu of timezones in their applications. This package simplifies the process of incorporating a timezone selection feature, saving developers valuable time and effort.

Installation

You can install the package via composer:

composer require baspa/laravel-timezones

Usage

Timezones grouped by continent

use Baspa\Timezones\Facades\Timezones;
// 
$groupedTimezones = Timezones::toArray(grouped: true);

All timezones

use Baspa\Timezones\Facades\Timezones;
// 
$timezones = Timezones::toArray();

Exclude continents

use Baspa\Timezones\Facades\Timezones;
// 
$timezones = Timezones::excludeContinents(['Africa', 'America'])
    ->toArray();

Show offset

$timezones = Timezones::showOffset()->toArray();
// or
$timezones = Timezones::showOffset(showOffset: false)->toArray();

Include general timezones

To include general timezones like GMT or UTC use the includeGeneral method.

$timezones = Timezones::includeGeneral()->toArray();

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

This package offers a convenient solution for Laravel developers who need to include a dropdown menu of timezones in their applications

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages