From 20e96cca0568b3e4220d03b360909701d6d73dee Mon Sep 17 00:00:00 2001 From: Philippe Gaultier Date: Thu, 24 Apr 2014 17:06:44 +0200 Subject: [PATCH 1/3] Fix DateTime cast --- framework/base/Formatter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/base/Formatter.php b/framework/base/Formatter.php index c958112892..b22ce4e3b2 100644 --- a/framework/base/Formatter.php +++ b/framework/base/Formatter.php @@ -357,11 +357,11 @@ class Formatter extends Component } catch (\Exception $e) { return false; } - $value = $date->format('U'); + $value = (double)$date->format('U'); } return $value; } elseif ($value instanceof DateTime || $value instanceof \DateTimeInterface) { - return $value->format('U'); + return (double)$value->format('U'); } else { return (double)$value; } From f0acb178b3244b3471ec1b0a3fd4601bd891774c Mon Sep 17 00:00:00 2001 From: Philippe Gaultier Date: Thu, 24 Apr 2014 17:06:56 +0200 Subject: [PATCH 2/3] Update changelog --- framework/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index da3fa47624..c12ad874e9 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -20,6 +20,7 @@ Yii Framework 2 Change Log - Bug #3194: Date formatter works only for timestamps in the year range 1970 to 2038 (kartik-v) - Bug #3204: `yii\di\Container` did not handle the `$config` parameter well in case when it does not have a default value (qiangxue) - Bug #3216: Fixed the bug that `yii.activeForm.destroy()` did not remove `submit` event handlers (qiangxue) +- Bug: Return value for DateTime->format('U') casted to double to allow correct date formatting (pgaultier) - Enh #2264: `CookieCollection::has()` will return false for expired or removed cookies (qiangxue) - Enh #2837: Error page now shows arguments in stack trace method calls (samdark) - Enh #3008: Added `Html::errorSummary()` (qiangxue) From 4727ecdb1b57b7fd22a25440e1c81ce5ca6b9b8b Mon Sep 17 00:00:00 2001 From: Philippe Gaultier Date: Thu, 24 Apr 2014 17:10:02 +0200 Subject: [PATCH 3/3] Set correct ticked ID --- framework/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index c12ad874e9..0fdaaab9d4 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -20,7 +20,7 @@ Yii Framework 2 Change Log - Bug #3194: Date formatter works only for timestamps in the year range 1970 to 2038 (kartik-v) - Bug #3204: `yii\di\Container` did not handle the `$config` parameter well in case when it does not have a default value (qiangxue) - Bug #3216: Fixed the bug that `yii.activeForm.destroy()` did not remove `submit` event handlers (qiangxue) -- Bug: Return value for DateTime->format('U') casted to double to allow correct date formatting (pgaultier) +- Bug #3236: Return value for DateTime->format('U') casted to double to allow correct date formatting (pgaultier) - Enh #2264: `CookieCollection::has()` will return false for expired or removed cookies (qiangxue) - Enh #2837: Error page now shows arguments in stack trace method calls (samdark) - Enh #3008: Added `Html::errorSummary()` (qiangxue)