]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix strftime in windows, use %#d instead of %e in windows
authorscambra <sergio@entrecables.com>
Fri, 19 Oct 2012 12:03:51 +0000 (14:03 +0200)
committerscambra <sergio@entrecables.com>
Tue, 23 Oct 2012 14:24:54 +0000 (16:24 +0200)
lib/l10n.php

index 41c89a7d4b58aedee8f76d153623a44c8292cd96..f1a2523c3071541f076eabd13fb686f908ed771c 100644 (file)
@@ -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':