84902[TASK] Use ISO8601 dates in FormEngine datetime handling
Commit message
Review
-
Code review CR +2 Done
- Andreas Kienast +2
- Benjamin Franzke +1
- Georg Ringer +1
- Benni Mack +1
-
Verified V +2 Done
- Andreas Kienast +2
- Benjamin Franzke +1
- Georg Ringer +1
- Benni Mack +1
- core-ci +1 CI
Issues 1
Files 18
- Build/Sources/TypeScript/backend/input/clearable.ts+2 −0
- Build/Sources/TypeScript/backend/tests/form-engine-validation-test.ts+30 −44
- Build/Sources/TypeScript/backend/date-time-picker.ts7+72 −63
- Build/Sources/TypeScript/backend/form-engine-validation.ts+27 −154
- Build/Sources/TypeScript/backend/form-engine.ts+2 −2
- Build/Sources/TypeScript/scheduler/scheduler.ts+7 −4
- typo3/sysext/backend/Classes/Form/Element/DatetimeElement.php3+1 −7
- typo3/sysext/backend/Resources/Public/JavaScript/input/clearable.js+1 −1
- typo3/sysext/backend/Resources/Public/JavaScript/date-time-picker.js+1 −1
- typo3/sysext/backend/Resources/Public/JavaScript/form-engine-validation.js+1 −1
- typo3/sysext/backend/Resources/Public/JavaScript/form-engine.js+1 −1
- typo3/sysext/belog/Resources/Private/Partials/Content/Filter.html+4 −12
- typo3/sysext/core/Tests/Acceptance/Application/FormEngine/AbstractElementsBasicCest.php+7 −5
- typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputDateCest.php1+31 −0
- typo3/sysext/scheduler/Resources/Private/Partials/AddEditStartEndFields.html+6 −8
- typo3/sysext/scheduler/Resources/Public/JavaScript/scheduler.js+1 −1
- typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_basic.php+6 −6
- typo3/sysext/styleguide/Resources/Private/Templates/Backend/Components/Filter.html+0 −10
Review log 5886
Show 3761 earlier messages
-
Andreas Kienast uploaded patch set 1 06/25/24, 13:13
-
core-ci voted on patch set 1 V -1 06/25/24, 13:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60297
-
Andreas Kienast uploaded patch set 2
V -106/25/24, 13:46 -
core-ci voted on patch set 2 V -1 06/25/24, 13:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60305
-
Andreas Kienast uploaded patch set 3
V -107/02/24, 13:35 -
core-ci voted on patch set 3 V -1 07/02/24, 13:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60842
-
Andreas Kienast uploaded patch set 4
V -107/02/24, 14:28 -
core-ci voted on patch set 4 V -1 07/02/24, 14:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60846
-
Andreas Kienast uploaded patch set 5
V -107/02/24, 14:59 -
core-ci voted on patch set 5 V -1 07/02/24, 15:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60849
-
Andreas Kienast uploaded patch set 6
V -107/03/24, 12:23 -
core-ci voted on patch set 6 V -1 07/03/24, 12:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60907
-
Andreas Kienast uploaded patch set 7
V -107/03/24, 15:27 -
core-ci voted on patch set 7 V -1 07/03/24, 15:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60912
-
Andreas Kienast uploaded patch set 8
V -107/04/24, 15:25 -
core-ci voted on patch set 8 V -1 07/04/24, 15:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60976
-
Andreas Kienast uploaded patch set 9
V -107/04/24, 15:45 -
core-ci voted on patch set 9 V -1 07/04/24, 15:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60978
-
Andreas Kienast voted on patch set 9 CR -1 07/04/24, 16:18
-
Andreas Kienast uploaded patch set 10
CR -1V -107/04/24, 17:51 -
Garvin Hicking commented on patch set 10 07/06/24, 08:34
Just a short note/question, because I believe you addressed this. In https://forge.typo3.org/issues/91508 it came up again that due to our initialization of the flatpickr with "dd-MM-yyyy" no dates with 3 digits can be handled (due to "yyyy" requiring four). Using the ISO date here, and trying to make sense of this complex code should fix the issue too, right? (Thanks for your efforts in this matter, much appreciated and valued!) -
Andreas Kienast commented on patch set 10 07/08/24, 06:41
Reply
Honestly, I have no idea whether this patch fixes the issue as well. -
Garvin Hicking commented on patch set 10 07/08/24, 07:26
Reply
I just checked; it properly now uses "0999" and is able to pick dates then. Yay, you! :) -
Andreas Kienast uploaded patch set 11 07/08/24, 09:13
-
core-ci voted on patch set 11 V -1 07/08/24, 09:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61170
-
Andreas Kienast uploaded patch set 12
V -107/08/24, 12:41 -
Andreas Kienast commented on patch set 12 V -1 07/08/24, 12:43
Scheduler task creation is broken now (╯°□°)╯︵ ┻━┻ -
core-ci voted on patch set 12 V -1 07/08/24, 12:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61172
-
Andreas Kienast uploaded patch set 13
V -107/08/24, 13:42 -
core-ci voted on patch set 13 V -1 07/08/24, 13:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61175
-
Andreas Kienast uploaded patch set 14
V -107/08/24, 14:56 -
core-ci voted on patch set 14 V -1 07/08/24, 15:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61177
-
Andreas Kienast uploaded patch set 15 07/08/24, 15:25
Copied Votes: * Verified-1 (copy condition: "**changekind:NO_CHANGE**") -
core-ci voted on patch set 15 V -1 07/08/24, 15:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61180
-
Andreas Kienast uploaded patch set 16
V -107/09/24, 11:42 -
core-ci voted on patch set 16 V +1 07/09/24, 11:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61233
-
Andreas Kienast uploaded patch set 17
V +107/09/24, 13:33 -
Benjamin Franzke commented on patch set 16 07/09/24, 13:38
date-time-picker.ts:141Hm, true for DateTimeInterface::ATOM (and the broken DateTimeInterface::ISO8601 constant) do not support milliseconds, but PHP DateTime can handle milliseconds: ``` const ISO8601U = "Y-m-d\TH:i:s.uO"; var_dump(DateTime::createFromFormat(ISO8601U, '2024-07-07T15:30:00.123Z')); object(DateTime)#1 (3) { ["date"]=> string(26) "2024-07-07 15:30:00.123000" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "Z" } ``` Also see https://www.php.net/manual/en/datetime.format.php > **u** Microseconds. Note that date() will always generate 000000 since it takes an int parameter, whereas DateTime::format() does support microseconds if DateTime was created with microseconds. That means this comment is not true. If there's another argument to not use milliseconds, we'd need to name that (like complication with existing stuff that generated/sends ISO8601 without milliseconds?) or because of fears with "the DataHandler"?... IMHO we should try to make it right and migrate all cases to generate ISO8601 with milliseconds and desired by ECMAScript: https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-date-time-string-format > ECMAScript defines a string interchange format for date-times based upon a simplification of the ISO 8601 calendar date extended format. The format is as follows: **YYYY-MM-DDTHH:mm:ss.sssZ**DatetimeElement.php:161I'm not sure this is still "ok", DatabaseRowDateTimeFields will create ISO8601, yes, but timezone-dependant ones. Shouldn't we normalized them to be Z-based here? Otherwise we'll have `00:00Z` for integer based fields and stuff like `00:00+01:00` for native datetime fields. -
core-ci voted on patch set 17 V +1 07/09/24, 13:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61238
-
Andreas Kienast uploaded patch set 18
V +107/09/24, 14:30 -
Andreas Kienast commented on patch set 18 CR -2 07/09/24, 14:35
-
core-ci voted on patch set 18 V +1 07/09/24, 14:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61244
-
Andreas Kienast uploaded patch set 19
V +107/09/24, 19:48Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Andreas Kienast voted on patch set 19 CR 0 07/09/24, 19:49
-
core-ci voted on patch set 19 V +1 07/09/24, 19:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61255
-
Andreas Kienast commented on patch set 19 07/09/24, 20:36
DatetimeElement.php:161ReplyIn general I think it'd make sense to have a unified format. However, I'd like to keep that out of this patch if that is fine for you. -
Andreas Kienast uploaded patch set 20
V +107/09/24, 20:37 -
core-ci voted on patch set 20 V +1 07/09/24, 20:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61258
-
Andreas Kienast uploaded patch set 21
V +107/10/24, 07:22 -
core-ci voted on patch set 21 V +1 07/10/24, 07:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61288
-
Andreas Kienast commented on patch set 21 V -1 07/10/24, 07:41
belog filtering is broken -
Andreas Kienast uploaded patch set 22
V +107/10/24, 08:00 -
core-ci voted on patch set 22 V +1 07/10/24, 08:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61292
-
Andreas Kienast uploaded patch set 23
V +107/10/24, 10:36 -
core-ci voted on patch set 23 V +1 07/10/24, 10:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61306
-
Andreas Kienast uploaded patch set 24
V +107/10/24, 10:44 -
core-ci voted on patch set 24 V +1 07/10/24, 10:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61308
-
Benjamin Franzke uploaded patch set 25
V +107/11/24, 10:07 -
Benjamin Franzke commented on patch set 25 07/11/24, 10:07
date-time-picker.ts:141ReplyDoneDatetimeElement.php:161ReplyAcknowledged -
core-ci voted on patch set 25 V +1 07/11/24, 10:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61370
-
Benjamin Franzke commented on patch set 25 07/11/24, 10:28
date-time-picker.ts:221Which bug? I can not find a bug without using `showMonths = 12`
-
Andreas Kienast commented on patch set 25 07/11/24, 10:33
date-time-picker.ts:221ReplyTestable with `inputdatetime_5` (also discovered by AC tests): * Focus field * Flush content * Enter an arbitrary time, e.g. "13:30" * Press TAB key * JS error: `TypeError: Cannot set properties of undefined (setting 'tabIndex')` flatpickr somehow thinks it's a great idea to update a month selector even if there is no month selector at all. -
Benjamin Franzke uploaded patch set 26
V +107/11/24, 13:31 -
Benjamin Franzke commented on patch set 26 07/11/24, 13:31
date-time-picker.ts:221ReplyAck, added a comment, and changed to directly configure the relevant option `monthSelectorType`, as mentioned on https://flatpickr.js.org/options/ > If showMonths has a value greater than 1, the month is always shown as static.ElementsBasicInputDateCest.php:126We now got milliseconds here, and I guess that's because Formengine now uses luxon toIso() (which will generate milliseconds) as intermediate format. For `date*` fields this intermediate format is formatted somehwere™️ before being added to the hidden field, while `time*` fields are not post-processes. Otherwise we have cases with and without milliseconds send to the server (which currently works, but I think we should try to streamline that). Fixed by suppressing milliseconds in the time/timesec processor. -
core-ci voted on patch set 26 V +1 07/11/24, 13:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61391
-
Simon Schaufelberger commented on patch set 26 07/12/24, 00:03
Do you want to rebase? -
Andreas Kienast uploaded patch set 27
V +107/12/24, 06:31 -
Andreas Kienast commented on patch set 27 07/12/24, 06:31
Reply
Done -
core-ci voted on patch set 27 V +1 07/12/24, 06:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61451
-
Benjamin Franzke commented on patch set 27 07/12/24, 07:08
date-time-picker.ts:139I kinda "dislike" that this is a very implicit hack that crops-away the (admittedly intermediate) locale-offset. I understand that this is desired (as we use js-date localtime as container for UTC, as flatpickr only supporse localtime Date, not UTC 🤦). I know it looks "worse", but I'm thinking about using an explicit approach like: ``` const dt = DateTime.fromJSDate(date); const iso = dt .setZone('utc') .plus(dt.offset * 60 * 1000) .toISO({ suppressMilliseconds: true }); ``` WDYT @a.fernandez@scripting-base.de ? -
Benjamin Franzke uploaded patch set 28
V +107/12/24, 08:22 -
core-ci voted on patch set 28 V +1 07/12/24, 08:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61464
-
Benjamin Franzke commented on patch set 28 CR +1 V +1 07/12/24, 12:25
date-time-picker.ts:139ReplyDone -
Christian Kuhn commented on patch set 28 07/12/24, 13:35
sure about v12? isn't this a bit too risky for v12? -
Andreas Kienast commented on patch set 28 07/12/24, 13:41
Reply
We need this as a preparation patch to fix broken FormEngine behavior if `SYS/ddmmyy` is configured to be e.g. `m/d/Y`. -
Benjamin Franzke commented on patch set 28 07/12/24, 14:17
Reply
I was very sceptical as well, but went through this patch a dozen times in order to ensure that this is good and does not introduce breaking changes. I'm confident that this can be merged. -
Georg Ringer voted on patch set 28 CR +1 V +1 07/12/24, 17:18
-
Georg Ringer commented on patch set 28 07/12/24, 17:19
is there a potential need for an important rst because extension authors might need to adopt code, e.g. when using own backend modules? -
Benjamin Franzke uploaded patch set 29
CR +1V +107/12/24, 19:06 -
core-ci voted on patch set 29 V +1 07/12/24, 19:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61506
-
Benjamin Franzke commented on patch set 29 07/12/24, 19:15
Reply
I would have considered this internal (of course it's not explicitly marked as such) – and yes, seems to be used externally: https://github.com/extcode/cart/blob/68de4536c14ef0312be3817cd27b32511660e9cc/Resources/Public/JavaScript/Backend/order-module.js#L9 https://github.com/extcode/cart/blob/68de4536c14ef0312be3817cd27b32511660e9cc/Resources/Private/Partials/Backend/Order/Filter/List.html#L29-L39 good catch, we need to handle this. -
Benjamin Franzke commented on patch set 29 CR +1 V +1 07/15/24, 06:17
Reply
added a compat layer in v12 backport https://review.typo3.org/c/Packages/TYPO3.CMS/+/85243/2..3 -
Benni Mack commented on patch set 29 CR +1 V +1 07/15/24, 12:02
Thanks for taking care of that one! -
Georg Ringer voted on patch set 29 CR +1 V +1 07/15/24, 12:19
-
Andreas Kienast voted on patch set 29 CR +2 V +2 07/15/24, 12:41
-
Andreas Kienast merged patch set 30 07/15/24, 12:41