Skip to content

Commit

Permalink
Partially revert default niceShortFormat
Browse files Browse the repository at this point in the history
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
markstory committed Jan 15, 2013
1 parent eff4004 commit ad0d664
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/Cake/Test/Case/Utility/CakeTimeTest.php
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Utility/CakeTime.php
Expand Up @@ -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()`
Expand Down

0 comments on commit ad0d664

Please sign in to comment.