diff options
author | hubaishan <saeed@hubaishan.com> | 2017-11-08 09:31:47 +0300 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2017-12-24 10:31:30 +0100 |
commit | 34d52a131b3422f6dc803ec2f46cfd5d0d8892c5 (patch) | |
tree | d7930e616d5bb23281a0c141b9700749d0657514 | |
parent | Merge pull request #5002 from JoshyPHP/ticket/15408 (diff) | |
download | phpbb-34d52a131b3422f6dc803ec2f46cfd5d0d8892c5.tar.gz phpbb-34d52a131b3422f6dc803ec2f46cfd5d0d8892c5.tar.bz2 phpbb-34d52a131b3422f6dc803ec2f46cfd5d0d8892c5.zip |
[ticket/14857] Throw `S` from dateformat for non English languages
Throw `S` (ordinal suffix) from dateformat for non English languages
PHPBB3-14857
-rw-r--r-- | phpBB/phpbb/datetime.php | 6 |
1 files changed, 6 insertions, 0 deletions
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); |