Skip to content

Commit ad0d664

Browse files
committed
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
1 parent eff4004 commit ad0d664

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/Cake/Test/Case/Utility/CakeTimeTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,12 @@ public function testNiceShort() {
367367
$time = time() + DAY;
368368
$this->assertEquals('Tomorrow, ' . date('H:i', $time), $this->Time->niceShort($time));
369369

370+
$time = strtotime('+6 days');
371+
$this->assertEquals('On ' . date('l F d, H:i', $time), $this->Time->niceShort($time));
372+
373+
$time = strtotime('-6 days');
374+
$this->assertEquals(date('l F d, H:i', $time), $this->Time->niceShort($time));
375+
370376
date_default_timezone_set('Europe/London');
371377
$result = $this->Time->niceShort('2005-01-15 10:00:00', new DateTimeZone('Europe/Brussels'));
372378
$this->assertEquals('Jan 15th 2005, 11:00', $result);

lib/Cake/Utility/CakeTime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class CakeTime {
5656
* @var string
5757
* @see CakeTime::niceShort()
5858
*/
59-
public static $niceShortFormat = '%d/%m, %H:%M';
59+
public static $niceShortFormat = '%B %d, %H:%M';
6060

6161
/**
6262
* The format to use when formatting a time using `CakeTime::timeAgoInWords()`

0 commit comments

Comments
 (0)