Review main Merged

84880[BUGFIX] Apply configured date format to date(time) fields

Benni Mack CR +2 V +2 Normal +94 −16 updated 08/23/24, 13:27

Commit message

With #104309 in place, TYPO3 is finally prepared to allow any date
configuration, as long it is supported in PHP.

This commit adjusts the last missing bits: the date format configured in
`TYPO3_CONF_VARS/SYS/ddmmyy` is now respected at every place that
configures a date time format for the JavaScript date picker component.
To achieve this, an internal method is introduced that converts the PHP
date format to a fomat that luxon understands, which appears to be
"inspired" by ICU date format tokens.

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
    • Benjamin Franzke +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Andreas Kienast +2
    • Benjamin Franzke +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 3

Files 6

Review log 1825

  1. Benni Mack uploaded patch set 1 06/24/24, 11:39

  2. core-ci voted on patch set 1 V -1 06/24/24, 11:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60170

  3. Benjamin Franzke uploaded patch set 2 V -1 07/12/24, 16:35

  4. Benjamin Franzke commented on patch set 2 07/12/24, 16:39

    FormResultCompiler.php:183

    While its quite nice to properly support the configured date format, it would be even nicer to not configure date format's at all. Also see https://moment.github.io/luxon/#/formatting?id=consider-alternatives > You shouldn't create ad-hoc string formats if you can avoid it. […] If a human will read it, prefer toLocaleString. That means we should actually only pass a locale (current backend users selected language) to luxon. That'll also requiry andy's patch – https://review.typo3.org/c/Packages/TYPO3.CMS/+/84902 – but will avoid having to create a format-mapper *and* will allow different formats for editors from different countries.
  5. core-ci voted on patch set 2 V -1 07/12/24, 16:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61499

  6. Benjamin Franzke uploaded patch set 3 V -1 07/12/24, 18:05

  7. core-ci voted on patch set 3 V -1 07/12/24, 18:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61504

  8. Benjamin Franzke uploaded patch set 4 V -1 07/12/24, 18:11

  9. core-ci voted on patch set 4 V +1 07/12/24, 18:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61505

  10. Benjamin Franzke uploaded patch set 5 V +1 07/12/24, 19:06

  11. core-ci voted on patch set 5 V +1 07/12/24, 19:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61507

  12. Andreas Kienast uploaded patch set 6 V +1 08/09/24, 08:41

  13. core-ci voted on patch set 6 V +1 08/09/24, 08:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63117

  14. Garvin Hicking commented on patch set 6 08/09/24, 10:11

    FormResultCompiler.php:183 Reply

    personally I prefer the backend in english, but I hate the default date representation there. So, as a user, I would probably like to pick a "date locale" different than a "language locale" (like OS's allow to configure).
  15. Benjamin Franzke commented on patch set 6 08/09/24, 11:55

    FormResultCompiler.php:183 Reply

    Ack, that'd be an additional FEATURE to support sth like `LC_TIME` on a per-user basis. FYI: The initial support for date-locale handling (so an alternative to this patch) would look like: https://review.typo3.org/c/Packages/TYPO3.CMS/+/85262 (It has it's own limitations: date presets are not very flexible and there is no way to parse a generated string back into a date object, that means it's not usable for a manually editable datepicker) Still I'd think that would be the better approach, as forcing `TYPO3_CONF_VARS/SYS/ddmmyy` to all users is really only an improvement if all editors have the same language/time-preference.
  16. Andreas Kienast voted on patch set 6 CR +1 V +1 08/12/24, 06:28

  17. Andreas Kienast commented on patch set 6 V 0 CR -1 08/12/24, 07:17

    Will be merged after the next 12.4 release
  18. Benjamin Franzke commented on patch set 6 08/12/24, 07:18

    FormResultCompiler.php:183 Reply

    I will skip this topic for now, respecting `TYPO3_CONF_VARS/SYS/ddmmyy` is perfectly fine for 12.4
  19. Andreas Kienast uploaded patch set 7 CR -1 V +1 08/16/24, 07:46

  20. core-ci voted on patch set 7 V +1 08/16/24, 07:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63554

  21. Andreas Kienast voted on patch set 7 CR +1 V +1 08/16/24, 07:56

  22. Simon Schaufelberger voted on patch set 7 CR +1 V +1 08/23/24, 12:26

  23. Benjamin Franzke voted on patch set 7 CR +1 V +1 08/23/24, 13:26

  24. Andreas Kienast voted on patch set 7 CR +2 V +2 08/23/24, 13:27

  25. Andreas Kienast merged patch set 8 08/23/24, 13:27