<DateRageInput> & <DateInput> - Incorrect calendar display based off of region
Closed this issue · 1 comments
Initial notification
Official Support ticket
Describe the bug
Many countries consider Monday to be the starting day of the calendar week.
Once profiles are set with the preferred user settings, the days adjust to the local calendar, but the days remain static, causing them to be one off.
**To Reproduce within an application **
1.) My Profile--> Personal Settings → Language & Region: English (United States) (en-US)
2.) Go to any date range within the application. Here is an example using a Dashboard widget.
1.) My Profile--> Personal Settings → Language & Region: English (United Kingdom) (en-GB)
2.) Go to any date range within the application.
This display is incorrect. October 23rd is a Monday, not Tuesday. The calendar correctly begins with Monday, but the days themselves remain in the fixed ‘starting on Sunday’ position.
With respect to the calendar select input showing the incorrect date when the week begins on a Monday, we have found that the issue is present in both the DateInput
and DateRangeInput
components residing in the commercetools-wide ui-kit
library (as shown in the attached screen recording).
This was detected with GB, but this is a reoccurring theme for all countries with Monday-starting calendars.
To reproduce within Storybook
Screen.Recording.2023-10-23.at.12.50.10.PM.mov
Additional Notes:
The correct start day of the week based for the UK en-GB
, Ireland en-IE
, and Australia en-AU
is Monday, according to the ISO-8601 standard.
The US en-US
and the fallback en locale both use Sunday as the first day of the week.
Currently, the date-handling library we are using has a bug where the first date of the week for Australia is set to Sunday. This explains why en-AU is inconsistent with en-GB/IE - this will be updated when the bug is fixed in the underlying library.
cc @jefflicopCT