From 34d52a131b3422f6dc803ec2f46cfd5d0d8892c5 Mon Sep 17 00:00:00 2001 From: hubaishan Date: Wed, 8 Nov 2017 09:31:47 +0300 Subject: [ticket/14857] Throw `S` from dateformat for non English languages Throw `S` (ordinal suffix) from dateformat for non English languages PHPBB3-14857 --- phpBB/phpbb/datetime.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phpBB/phpbb/datetime.php b/phpBB/phpbb/datetime.php index 63cdba90fd..4b799b6219 100644 --- a/phpBB/phpbb/datetime.php +++ b/phpBB/phpbb/datetime.php @@ -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); -- cgit v1.2.3-65-gdbad