You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Class IntlDateFormatter displays weekday and week number incorrectly. The example date is 2021-01-02, which belongs to the last week of 2020. In addition, the number of the day of the week is displayed incorrectly.
The issue is the definition of the IntlDateFormatter::GREGORIAN calendar: it has the first week of the ISO year using a minimum of 1 day, instead of the usual 4 days. It also has Sunday as the first day of the week instead of Monday. So that's why it says Saturday is 7 and the week is 2021-01.
If I create an IntlCalendar with Monday as the first day of the week and a minimum of 4 days in the first week, like the 8601 standard typically uses, and pass that to IntlDateFormatter, I get 6=Sat and 2020-53.
Description
Class IntlDateFormatter displays weekday and week number incorrectly. The example date is 2021-01-02, which belongs to the last week of 2020. In addition, the number of the day of the week is displayed incorrectly.
Resulted in this output:
But I expected this output instead:
PHP Version
PHP 7.2.5 .. 8.3.7
Operating System
openSUSE Leap + Tumbleweed, Debian 11
The text was updated successfully, but these errors were encountered: