ソースを参照

return default if null

Mark Scherer 9 年 前
コミット
0df0e8db51
1 ファイル変更4 行追加0 行削除
  1. 4 0
      src/Utility/Time.php

+ 4 - 0
src/Utility/Time.php

@@ -550,6 +550,10 @@ class Time extends CakeTime {
 			$options['timezone'] = static::safeCreateDateTimeZone($options['timezone']);
 		}
 
+		if ($dateString === null) {
+			return $options['default'];
+		}
+
 		if (!is_object($dateString)) {
 			$date = new DateTime($dateString, $options['timezone']);
 		} else {