Skip to content

Conversation

@driusan
Copy link
Collaborator

@driusan driusan commented Oct 17, 2025

The IntlDateFormatter in PHP uses the value of intl.default_locale, not \setlocale in order to decide on the formatting to use for dates when a null value/empty string is passed as the locale.

This explicitly sets it so that dates in the en-CA locale are formatted as YYYY-mm-dd instead of YYYY/mm/dd.

  • Resolves -- a comment that @racostas made, I can't find an issue for it.

The IntlDateFormatter in PHP uses the value of intl.default_locale, not
\setlocale in order to decide on the formatting to use for dates when a
null value/empty string is passed as the locale.

This explicitly sets it so that dates in the en-CA locale are formatted
as YYYY-mm-dd instead of YYYY/mm/dd.
@github-actions github-actions bot added the Language: PHP PR or issue that update PHP code label Oct 17, 2025
@racostas
Copy link
Contributor

For a bit of context/history I think this was detected and discussed a bit in #10024, ( then after mostly orally).

This fix looks good to me.

@racostas racostas self-requested a review October 20, 2025 20:22
Copy link
Contributor

@racostas racostas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

This is how it was show before the PR for de default Canadian English language:
image

After this PR:
image

@racostas racostas added Multilingual Any tasks related to making LORIS multilingual Passed manual tests PR has been successfully tested by at least one peer labels Oct 20, 2025
@driusan driusan merged commit 11097fe into aces:main Oct 21, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language: PHP PR or issue that update PHP code Multilingual Any tasks related to making LORIS multilingual Passed manual tests PR has been successfully tested by at least one peer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants