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
January 2028 with startOfWeek = 0 looks like this:
but in the US (or en-US locale) it should be:
this is because of the rule what the first week is
for ISO that is where the first 4 days are in (so because iso starts on Monday, the Thursday should at least 1 Jan., so that Thursday -> Sunday are the 4 days in the new year)
But for US the rule is where day 1 is in.. so first of January.
Prerequisites
Describe the issue
January 2028 with startOfWeek = 0 looks like this:
but in the US (or en-US locale) it should be:
this is because of the rule what the first week is
for ISO that is where the first 4 days are in (so because iso starts on Monday, the Thursday should at least 1 Jan., so that Thursday -> Sunday are the 4 days in the new year)
But for US the rule is where day 1 is in.. so first of January.
this information is now provided by most current browsers: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo
For chromium its nog getWeekInfo() as a function but it is:
const uk = new Intl.Locale("en-UK")
uk.weekInfo
which the gives you firstDay and also minimalDays
StackBlitz fork
https://stackblitz.com/edit/tempus-dominus-v6-repl-fif9uy?file=example.js
What operating system(s) are you seeing the problem on?
Windows, macOS, Linux
What browser(s) are you seeing the problem on?
Microsoft Edge
What version of are you using? You can find this information from the sample StackBlitz.
6.7.11
What your browser's locale? You can find this information from the sample StackBlitz.
nl but the problem is showing for the us locale
The text was updated successfully, but these errors were encountered: