yii2mod/yii2-timezone Timezone helper

component

Yii 2 Timezone

Timezone component for Yii 2

Latest Stable Version Total Downloads License

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist yii2mod/yii2-timezone "*"

or add

"yii2mod/yii2-timezone": "*"

to the require section of your composer.json.

Usage

Currently firefox and edge browsers are not supported.

Once the extension is installed, simply add component to your main config file:

    'bootstrap' => [
        'timezone'
    ]
    .....
    'components' => [
        'timezone' => [
            'class' => 'yii2mod\timezone\Timezone',
            'actionRoute' => '/site/timezone' //optional param - full path to page must be specified
        ],
    ]

Then add new action to any controller (SiteController by default)

public function actions()
    {
        return [
            'timezone' => [
                'class' => 'yii2mod\timezone\TimezoneAction',
            ],
        ];
    }

After configuration you can use Yii::$app->timezone->name to get current user's timezone.

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



1.0.3 is the latest of 4 releases



MIT license
Stats
14 github stars & 3 github forks
3 downloads in the last day
101 downloads in the last 30 days
4248 total downloads