diff --git a/lib/Cake/Test/Case/Utility/CakeTimeTest.php b/lib/Cake/Test/Case/Utility/CakeTimeTest.php index f21d066c88a..c0c30ff77d4 100644 --- a/lib/Cake/Test/Case/Utility/CakeTimeTest.php +++ b/lib/Cake/Test/Case/Utility/CakeTimeTest.php @@ -367,6 +367,12 @@ public function testNiceShort() { $time = time() + DAY; $this->assertEquals('Tomorrow, ' . date('H:i', $time), $this->Time->niceShort($time)); + $time = strtotime('+6 days'); + $this->assertEquals('On ' . date('l F d, H:i', $time), $this->Time->niceShort($time)); + + $time = strtotime('-6 days'); + $this->assertEquals(date('l F d, H:i', $time), $this->Time->niceShort($time)); + date_default_timezone_set('Europe/London'); $result = $this->Time->niceShort('2005-01-15 10:00:00', new DateTimeZone('Europe/Brussels')); $this->assertEquals('Jan 15th 2005, 11:00', $result); diff --git a/lib/Cake/Utility/CakeTime.php b/lib/Cake/Utility/CakeTime.php index 35c7241d0b8..c2b54979888 100644 --- a/lib/Cake/Utility/CakeTime.php +++ b/lib/Cake/Utility/CakeTime.php @@ -56,7 +56,7 @@ class CakeTime { * @var string * @see CakeTime::niceShort() */ - public static $niceShortFormat = '%d/%m, %H:%M'; + public static $niceShortFormat = '%B %d, %H:%M'; /** * The format to use when formatting a time using `CakeTime::timeAgoInWords()`