ソースを参照

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.
 	 * @throws \Cake\Core\Exception\Exception When the engine class could not be found.
 	 */
 	 */
 	public function __construct(View $View, array $config = []) {
 	public function __construct(View $View, array $config = []) {
-		parent::__construct($View, $config);
-
 		$defaults = [
 		$defaults = [
 			'outputTimezone' => Configure::read('App.defaultOutputTimezone')
 			'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');
 		$engineClass = App::className($config['engine'], 'Utility');
 		if (!$engineClass) {
 		if (!$engineClass) {
 			throw new Exception(sprintf('Class for %s could not be found', $config['engine']));
 			throw new Exception(sprintf('Class for %s could not be found', $config['engine']));