mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix strftime in windows, use %#d instead of %e in windows
This commit is contained in:
parent
ab944094e2
commit
9601352d46
1 changed files with 6 additions and 1 deletions
|
|
@ -223,7 +223,12 @@ class OC_L10N{
|
|||
$locales[] = $locales[0].'_'.strtoupper($locales[0]);
|
||||
}
|
||||
setlocale(LC_TIME, $locales);
|
||||
return strftime($this->localizations[$type], $data);
|
||||
$format = $this->localizations[$type];
|
||||
// Check for Windows to find and replace the %e modifier correctly
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
|
||||
$format = preg_replace('#(?<!%)((?:%%)*)%e#', '\1%#d', $format);
|
||||
}
|
||||
return strftime($format, $data);
|
||||
break;
|
||||
case 'firstday':
|
||||
case 'jsdate':
|
||||
|
|
|
|||
Loading…
Reference in a new issue