1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-13 04:13:29 +02:00

[ticket/14857] Throw S from dateformat for non English languages

Throw `S` (ordinal suffix) from dateformat for non English languages

PHPBB3-14857
This commit is contained in:
hubaishan 2017-11-08 09:31:47 +03:00 committed by Marc Alexander
parent 44d5bde616
commit 34d52a131b
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995

View File

@ -60,6 +60,12 @@ class datetime extends \DateTime
public function format($format = '', $force_absolute = false)
{
$format = $format ? $format : $this->user->date_format;
if (substr($this->user->lang_name, 0,2) != 'en')
{
$format = preg_replace('/([^\\\])S/','$1', $format);
}
$format = self::format_cache($format, $this->user);
$relative = ($format['is_short'] && !$force_absolute);
$now = new self($this->user, 'now', $this->user->timezone);