dev-master
9999999-devTimezone helper
MIT
The Requires
component yii2
Timezone helper
Timezone component for Yii 2, (*1)
The preferred way to install this extension is through composer., (*3)
Either run, (*4)
php composer.phar require --prefer-dist yii2mod/yii2-timezone "*"
or add, (*5)
"yii2mod/yii2-timezone": "*"
to the require section of your composer.json., (*6)
Currently firefox and edge browsers are not supported., (*7)
Once the extension is installed, simply add component to your main config file:, (*8)
'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), (*9)
public function actions() { return [ 'timezone' => [ 'class' => 'yii2mod\timezone\TimezoneAction', ], ]; }
After configuration you can use Yii::$app->timezone->name
to get current user's timezone., (*10)
Timezone helper
MIT
component yii2