Fix: I18N formatter user timezone not set

This commit is contained in:
buddh4 2017-07-13 23:58:41 +02:00
parent 6a76ab8026
commit 889d1b16f9

View File

@ -10,6 +10,7 @@ namespace humhub\components\i18n;
use Yii;
use humhub\models\forms\ChooseLanguage;
use yii\base\Exception;
/**
* I18N provides features related with internationalization (I18N) and localization (L10N).
@ -54,9 +55,10 @@ class I18N extends \yii\i18n\I18N
$this->setDefaultLocale();
}
if (!($user->time_zone)) {
if (!empty($user->time_zone)) {
Yii::$app->formatter->timeZone = $user->time_zone;
}
Yii::$app->formatter->defaultTimeZone = Yii::$app->timeZone;
$this->fixLocaleCodes();