[BUGFIX] Prefix single digit dates with 0 instead of whitespace 89/53189/2
authorSascha Egerer <sascha@sascha-egerer.de>
Mon, 12 Jun 2017 11:05:46 +0000 (13:05 +0200)
committerBenni Mack <benni@typo3.org>
Mon, 12 Jun 2017 13:20:18 +0000 (15:20 +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
Reviewed-on: https://review.typo3.org/53189
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Manuel Selbach <manuel_selbach@yahoo.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/core/Classes/Database/QueryView.php

index 71b1d0c..1379812 100644 (file)
@@ -835,15 +835,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;