1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-24 09:30:34 +01:00

Merge pull request #5037 from hubaishan/ticket/14857

[ticket/14857] Throw `S` from dateformat for non English languages
This commit is contained in:
Marc Alexander 2017-12-27 19:13:59 +01:00
commit 8f662eac40
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);