TL;DR: new Intl.Locale("en-GB").getWeekInfo() tells you the week starts on Monday and the weekend is Saturday and Sunday. With Firefox 153, the whole Intl.Locale info family is Baseline Newly available, so you can delete that hand-rolled "first day of week" table.
The line nobody wants to touch
Every date picker has it somewhere.
const FIRST_DAY = 0 ; // Sunday. Probably. Ask product.
Enter fullscreen mode
Exit fullscreen mode
Then a user in London opens the calendar and the week starts on the wrong day. Someone adds if (locale === "en-GB") ... , then a lookup table, then a ticket about Israel, where the weekend is Friday and Saturday. The table grows. Nobody is sure where the data came from.
The browser already ships that data. It has been sitting in the Unicode CLDR tables that power Intl.DateTimeFormat all along.…