Permalink
Browse files

Partially revert default niceShortFormat

In 9fa531d the default niceShortFormat
was changed, which has been interpreted as a regression in #3533.

This change partially reverts the previous change and tries to strike
a balance between the old behavior and new.

Refs #3533
  • Loading branch information...
1 parent eff4004 commit ad0d6644c4d632943a7c142ec4c26400302657e5 @markstory markstory committed Jan 15, 2013
Showing with 7 additions and 1 deletion.
  1. +6 −0 lib/Cake/Test/Case/Utility/CakeTimeTest.php
  2. +1 −1 lib/Cake/Utility/CakeTime.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);
@@ -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()`

0 comments on commit ad0d664

Please sign in to comment.