Review main Merged

78120[FEATURE] Introduce php-intl based date&time formatting

Benni Mack CR +2 V +2 Hard +493 −3 updated 03/17/23, 14:18

Commit message

A new stdWrap "formattedDate" feature is added,
which uses the ICU-based pattern formatting
see https://unicode-org.github.io/icu/userguide/format_parse/datetime/#datetime-format-syntax

In addition, the DateViewHelper (<f:format.date>)
now allows to set a `pattern` value,
which - if given - also uses the ICU-based pattern
formatting.

All of the features are based on the given Locale,
so no need for using the system-wide "setlocale"
functionality is needed anymore, as the tests show.

The ICU-based pattern allows for much more flexible
and fine-grained date formatting, such as

* Quarter of the year (QQQQ)
* Day of week in month (F)
* Milliseconds in day (A)

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 7

Review log 2433

Show 58 earlier messages
  1. Benni Mack uploaded patch set 1 03/14/23, 14:07

  2. core-ci voted on patch set 1 V -1 03/14/23, 14:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38928

  3. Benni Mack uploaded patch set 2 V -1 03/16/23, 20:22

  4. core-ci voted on patch set 2 V +1 03/16/23, 20:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39069

  5. Benni Mack uploaded patch set 3 V +1 03/16/23, 21:40

  6. Benni Mack uploaded patch set 4 03/16/23, 21:42

  7. Benni Mack updated the commit message in patch set 5 03/16/23, 21:47

  8. core-ci voted on patch set 4 V -1 03/16/23, 21:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39074

  1. core-ci voted on patch set 5 V -1 03/16/23, 22:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39075

  2. core-ci voted on patch set 3 V -1 03/16/23, 22:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39073

  3. Benni Mack uploaded patch set 6 V -1 03/16/23, 22:07

  4. core-ci voted on patch set 6 V +1 03/16/23, 22:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39077

  5. Georg Ringer commented on patch set 6 03/17/23, 07:16

    Feature-100187-ICU-basedDateAndTimeFormatting.rst:22

    the bigger issue which also should be mentioned is that this is deprecated with PHP 8.1

    ContentObjectRenderer.php:1924

    this could be false. should be check that below?
  6. Stefan Bürk commented on patch set 6 03/17/23, 07:17

    DateViewHelper.php:105

    Should we not add the new arguments as description here - I guess this is used for ViewHelper api rendering or something like that.

    DateViewHelper.php:127

    Should we somehow emphasize that if `pattern` and `format` are both given, `pattern`has the higher order and is taken over the old format argument ?

    DateViewHelper.php:194

    Introducing new global variable access here ? At least, we should hand over the `$renderingContext` and look if the request is set there - and doing this as fallback here. Or can we avoid the fallback at all somehow and avoid introducing new global variable usage ?
  7. Benni Mack commented on patch set 6 03/17/23, 08:54

    Feature-100187-ICU-basedDateAndTimeFormatting.rst:22 Reply

    That's a separate issue which I want to address separately (= this won't be an issue anymore with my next patch)

    DateViewHelper.php:194 Reply

    good point, thank you

    ContentObjectRenderer.php:1924 Reply

    good point, will fix
  8. Benni Mack uploaded patch set 7 V +1 03/17/23, 09:22

  9. Benni Mack commented on patch set 7 03/17/23, 09:23

    Feature-100187-ICU-basedDateAndTimeFormatting.rst:22 Reply

    Done

    DateViewHelper.php:127 Reply

    Done

    DateViewHelper.php:194 Reply

    Done

    ContentObjectRenderer.php:1924 Reply

    Done
  10. core-ci voted on patch set 7 V +1 03/17/23, 09:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39109

  11. Georg Ringer voted on patch set 7 V +1 CR +1 03/17/23, 09:38

  12. Oli Bartsch commented on patch set 7 CR -1 03/17/23, 11:18

    reviewing
  13. Oli Bartsch uploaded patch set 8 CR +1 V +1 03/17/23, 11:54

  14. Oli Bartsch voted on patch set 8 V +1 CR +1 03/17/23, 11:56

  15. Oli Bartsch commented on patch set 8 03/17/23, 11:56

    DateViewHelper.php:105 Reply

    Done
  16. Georg Ringer voted on patch set 8 V +1 CR +1 03/17/23, 11:57

  17. core-ci voted on patch set 8 V +1 03/17/23, 12:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39119

  18. Stefan Bürk voted on patch set 8 V +1 CR +1 03/17/23, 12:03

  19. Stefan Bürk voted on patch set 8 CR -1 03/17/23, 12:03

  20. Stefan Bürk commented on patch set 9 CR +1 V +1 03/17/23, 12:04

    Published edit on patch set 8.
  21. Stefan Bürk voted on patch set 9 V +1 CR +1 03/17/23, 12:04

  22. core-ci voted on patch set 9 V +1 03/17/23, 12:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39120

  23. Oli Bartsch voted on patch set 9 V +1 CR +1 03/17/23, 14:08

  24. Benni Mack voted on patch set 9 V +2 CR +2 03/17/23, 14:18

  25. Benni Mack merged patch set 10 03/17/23, 14:18