mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Add strftime() support to CakeTime::timeAgoInWords()
When an absolute date is generated CakeTime will automatically use strftime() if the format string contains %. This allows for simpler localization. Refs #4550
This commit is contained in:
parent
d715c6f2de
commit
244acc724d
1 changed files with 5 additions and 1 deletions
|
@ -796,7 +796,11 @@ class CakeTime {
|
|||
}
|
||||
|
||||
if ($diff > abs($now - self::fromString($end))) {
|
||||
return sprintf($absoluteString, date($format, $inSeconds));
|
||||
return sprintf($absoluteString,
|
||||
(strpos($format, '%') === false) ?
|
||||
date($format, $inSeconds) :
|
||||
self::_strftime($format, $inSeconds)
|
||||
);
|
||||
}
|
||||
|
||||
// If more than a week, then take into account the length of months
|
||||
|
|
Loading…
Reference in a new issue