[BUGFIX] Prefix single digit dates with 0 instead of whitespace 92/53192/3
authorSascha Egerer <sascha@sascha-egerer.de>
Mon, 12 Jun 2017 11:05:46 +0000 (13:05 +0200)
committerSascha Egerer <sascha@sascha-egerer.de>
Mon, 12 Jun 2017 19:44:21 +0000 (21:44 +0200)
The backend query view, used for csv exports and lists, uses a date
format where single digit days of a date value are prefixed with a
whitespace instead of a 0.
This ends up in useless CSV exports that can not be interpreted by
tools like Excel.

Change-Id: Ie11c5f8a923eb412f014f06df528a2aa0101a0d4
Resolves: #81551
Releases: master,8.7,7.6
Reviewed-on: https://review.typo3.org/53192
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Sascha Egerer <sascha@sascha-egerer.de>
typo3/sysext/core/Classes/Database/QueryView.php

index 074faeb..15399e9 100644 (file)
@@ -691,15 +691,15 @@ class QueryView
         switch ($fields['type']) {
             case 'date':
                 if ($fieldValue != -1) {
-                    $out = strftime('%e-%m-%Y', $fieldValue);
+                    $out = strftime('%d-%m-%Y', $fieldValue);
                 }
                 break;
             case 'time':
                 if ($fieldValue != -1) {
                     if ($splitString == '<br />') {
-                        $out = strftime('%H:%M' . $splitString . '%e-%m-%Y', $fieldValue);
+                        $out = strftime('%H:%M' . $splitString . '%d-%m-%Y', $fieldValue);
                     } else {
-                        $out = strftime('%H:%M %e-%m-%Y', $fieldValue);
+                        $out = strftime('%H:%M %d-%m-%Y', $fieldValue);
                     }
                 }
                 break;