浏览代码

Fix output timezone config.

mscherer 7 年之前
父节点
当前提交
9ec994cf45
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      src/View/Helper/TimeHelper.php

+ 4 - 3
src/View/Helper/TimeHelper.php

@@ -51,13 +51,14 @@ class TimeHelper extends CakeTimeHelper {
 	 * @throws \Cake\Core\Exception\Exception When the engine class could not be found.
 	 */
 	public function __construct(View $View, array $config = []) {
-		parent::__construct($View, $config);
-
 		$defaults = [
 			'outputTimezone' => Configure::read('App.defaultOutputTimezone')
 		];
-		$config = $this->_config + $defaults;
+		$config += $defaults;
 
+		parent::__construct($View, $config);
+
+		$config = $this->_config + $defaults;
 		$engineClass = App::className($config['engine'], 'Utility');
 		if (!$engineClass) {
 			throw new Exception(sprintf('Class for %s could not be found', $config['engine']));