8000 [TASK] Use ISO 8601 format for date rendering · TYPO3/typo3@9e94d70 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 9e94d70

Browse files
mbrodalabmack
authored andcommitted
[TASK] Use ISO 8601 format for date rendering
Resolves: #103496 Releases: main, 12.4 Change-Id: I688540c91e85d28eec1951305d63028efa27eb82 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83653 Reviewed-by: Oliver Hader <oliver.hader@typo3.org> Tested-by: core-ci <typo3@b13.com> Tested-by: Oliver Hader <oliver.hader@typo3.org> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Benni Mack <benni@typo3.org>
1 parent 56e8436 commit 9e94d70

File tree

10 files changed

+47
-22
lines changed

10 files changed

+47
-22
lines changed

typo3/sysext/backend/Tests/Functional/RecordList/DownloadRecordListTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function downloadReturnsAListOfAllBackendUsers(): void
6868
'email' => '',
6969
'realName' => '',
7070
'admin' => 'Yes',
71-
'crdate' => '22-04-13 14:55',
71+
'crdate' => '2013-04-22 14:55',
7272
],
7373
], $this->prepareRecordsForDbCompatAssertions($result));
7474
}

typo3/sysext/backend/Tests/Unit/Controller/File/FileControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function flattenResultDataValueFlattensFile(): void
8080
self::assertSame(
8181
[
8282
'id' => 'foo',
83-
'date' => '29-11-73',
83+
'date' => '1973-11-29',
8484
'icon' => '',
8585
'thumbUrl' => '',
8686
'path' => '',

typo3/sysext/backend/Tests/Unit/Form/Element/AbstractFormElementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static function formatValueDataProvider(): array
8282
'format' => 'datetime',
8383
],
8484
'1412358894',
85-
'03-10-14 17:54',
85+
'2014-10-03 17:54',
8686
],
8787
'format to datetime with empty value' => [
8888
[

typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaRecordTitleTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ public static function addDataReturnsRecordTitleForDatetimeTypeDataProvider(): a
265265
'format' => 'date',
266266
],
267267
'978307261',
268-
'01-01-01 (-7 days)',
268+
'2001-01-01 (-7 days)',
269269
],
270270
'date (dbType: date)' => [
271271
[
@@ -274,7 +274,7 @@ public static function addDataReturnsRecordTitleForDatetimeTypeDataProvider(): a
274274
'dbType' => 'date',
275275
],
276276
'2001-01-01',
277-
'01-01-01 (-7 days)',
277+
'2001-01-01 (-7 days)',
278278
],
279279
'date (disableAgeDisplay: TRUE)' => [
280280
[
@@ -283,7 +283,7 @@ public static function addDataReturnsRecordTitleForDatetimeTypeDataProvider(): a
283283
'disableAgeDisplay' => true,
284284
],
285285
'978307261',
286-
'01-01-01',
286+
'2001-01-01',
287287
],
288288
'time' => [
289289
[
@@ -325,15 +325,15 @@ public static function addDataReturnsRecordTitleForDatetimeTypeDataProvider(): a
325325
'dbType' => 'date',
326326
],
327327
'978307261',
328-
'01-01-01 00:01',
328+
'2001-01-01 00:01',
329329
],
330330
'datetime (dbType: datetime)' => [
331331
[
332332
'type' => 'datetime',
333333
'dbType' => 'datetime',
334334
],
335335
'2014-12-31 23:59:59',
336-
'31-12-14 23:59',
336+
'2014-12-31 23:59',
337337
],
338338
];
339339
}

typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -562,27 +562,27 @@ public function getProcessedValueDisplaysAgeForDateInputFieldsIfSettingAbsent():
562562
],
563563
],
564564
];
565-
self::assertSame('28-08-15 (-2 days)', BackendUtility::getProcessedValue('tt_content', 'date', mktime(0, 0, 0, 8, 28, 2015)));
565+
self::assertSame('2015-08-28 (-2 days)', BackendUtility::getProcessedValue('tt_content', 'date', mktime(0, 0, 0, 8, 28, 2015)));
566566
}
567567

568568
public static function inputTypeDateDisplayOptions(): array
569569
{
570570
return [
571571
'typeSafe Setting' => [
572572
true,
573-
'28-08-15',
573+
'2015-08-28',
574574
],
575575
'non typesafe setting' => [
576576
1,
577-
'28-08-15',
577+
'2015-08-28',
578578
],
579579
'setting disabled typesafe' => [
580580
false,
581-
'28-08-15 (-2 days)',
581+
'2015-08-28 (-2 days)',
582582
],
583583
'setting disabled not typesafe' => [
584584
0,
585-
'28-08-15 (-2 days)',
585+
'2015-08-28 (-2 days)',
586586
],
587587
];
588588
}
@@ -1123,8 +1123,8 @@ public function dateTimeAgeReturnsCorrectValues(): void
11231123
$GLOBALS['LANG'] = $languageServiceMock;
11241124
$GLOBALS['EXEC_TIME'] = mktime(0, 0, 0, 3, 23, 2016);
11251125

1126-
self::assertSame('24-03-16 00:00 (-1 day)', BackendUtility::dateTimeAge($GLOBALS['EXEC_TIME'] + 86400));
1127-
self::assertSame('24-03-16 (-1 day)', BackendUtility::dateTimeAge($GLOBALS['EXEC_TIME'] + 86400, 1, 'date'));
1126+
self::assertSame('2016-03-24 00:00 (-1 day)', BackendUtility::dateTimeAge($GLOBALS['EXEC_TIME'] + 86400));
1127+
self::assertSame('2016-03-24 (-1 day)', BackendUtility::dateTimeAge($GLOBALS['EXEC_TIME'] + 86400, 1, 'date'));
11281128
}
11291129

11301130
#[Test]

typo3/sysext/core/Configuration/DefaultConfiguration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
'cookieDomain' => '',
8585
'trustedHostsPattern' => 'SERVER_NAME',
8686
'devIPmask' => '127.0.0.1,::1',
87-
'ddmmyy' => 'd-m-y',
87+
'ddmmyy' => 'Y-m-d',
8888
'hhmm' => 'H:i',
8989
'loginCopyrightWarrantyProvider' => '',
9090
'loginCopyrightWarrantyURL' => '',

typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ SYS:
8787
description: 'Defines a list of IP addresses which will allow development-output to display. The debug() function will use this as a filter. See the function <code>\TYPO3\CMS\Core\Utility\GeneralUtility::cmpIP()</code> for details on syntax. Setting this to blank value will deny all. Setting to "*" will allow all.'
8888
ddmmyy:
8989
type: text
90-
description: 'Format of Day-Month-Year - see PHP-function <a href="https://php.net/date" target="_blank" rel="noreferrer">date()</a>'
90+
description: 'Format of dates (without times) - see PHP-function <a href="https://php.net/date" target="_blank" rel="noreferrer">date()</a>'
9191
hhmm:
9292
type: text
93-
description: 'Format of Hours-Minutes - see PHP-function <a href="https://php.net/date" target="_blank" rel="noreferrer">date()</a>'
93+
description: 'Format of times (without dates) - see PHP-function <a href="https://php.net/date" target="_blank" rel="noreferrer">date()</a>'
9494
defaultScheme:
9595
type: text
9696
allowedValues:
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.. include:: /Includes.rst.txt
2+
3+
.. _important-103496-1711623416:
4+
5+
=======================================================
6+
Important: #103496 - ISO format used for date rendering
7+
=======================================================
8+
9+
See :issue:`103496`
10+
11+
Description
12+
===========
13+
14+
The default format for date rendering configured in :php:`$GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy']` has changed.
15+
16+
The former arbitrary :php:`'d-m-y'` format was replaced with the standard ISO 8601 :php:`'Y-m-d'` format.
17+
18+
Examples of dates where the :php:`'d-m-y'` format led to unclear dates:
19+
20+
* A 2-digit year could also be a day in a month: `21-04-23` could be understood as `2021-04-23` instead of `2023-04-21`.
21+
* The century of years could not be distinguished: `21-04-71` could be `2071-04-21` or `1971-04-21`
22+
23+
This affects date display in various locations so code relying on the previous format (e.g. acceptance tests) must be updated accordingly.
24+
25+
.. index:: Backend, CLI, Frontend, TCA, ext:core

typo3/sysext/core/Tests/Functional/Authentication/Mfa/Provider/RecoveryCodesProviderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ public function editViewTest(): void
230230

231231
self::assertMatchesRegularExpression('/<td>.*Name.*<td>.*some name/s', $response);
232232
self::assertMatchesRegularExpression('/<td>.*Recovery codes left.*<td>.*2/s', $response);
233-
self::assertMatchesRegularExpression('/<td>.*Last updated.*<td>.*18-03-21/s', $response);
234-
self::assertMatchesRegularExpression('/<td>.*Last used.*<td>.*18-03-21/s', $response);
233+
self::assertMatchesRegularExpression('/<td>.*Last updated.*<td>.*2021-03-18/s', $response);
234+
self::assertMatchesRegularExpression('/<td>.*Last used.*<td>.*2021-03-18/s', $response);
235235
self::assertMatchesRegularExpression('/<input.*id="regenerateCodes"/s', $response);
236236
}
237237

typo3/sysext/core/Tests/Functional/Authentication/Mfa/Provider/TotpProviderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ public function editViewTest(): void
241241
$response = $this->subject->handleRequest($request, $propertyManager, MfaViewType::EDIT)->getBody()->getContents();
242242

243243
self::assertMatchesRegularExpression('/<td>.*Name.*<td>.*some name/s', $response);
244-
self::assertMatchesRegularExpression('/<td>.*Last updated.*<td>.*18-03-21/s', $response);
245-
self::assertMatchesRegularExpression('/<td>.*Last used.*<td>.*18-03-21/s', $response);
244+
self::assertMatchesRegularExpression('/<td>.*Last updated.*<td>.*2021-03-18/s', $response);
245+
self::assertMatchesRegularExpression('/<td>.*Last used.*<td>.*2021-03-18/s', $response);
246246
}
247247

248248
#[Test]

0 commit comments

Comments
 (0)
0