Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

week calculation follows only ISO? #2844

Open
3 tasks done
jcompagner opened this issue Jul 27, 2023 · 1 comment
Open
3 tasks done

week calculation follows only ISO? #2844

jcompagner opened this issue Jul 27, 2023 · 1 comment
Labels
State: Triage Tickets that need to be triaged. Type: Bug

Comments

@jcompagner
Copy link
Contributor

Prerequisites

Describe the issue

January 2028 with startOfWeek = 0 looks like this:

image

but in the US (or en-US locale) it should be:

image

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

@jcompagner jcompagner added State: Triage Tickets that need to be triaged. Type: Bug labels Jul 27, 2023
@stackblitz
Copy link

stackblitz bot commented Jul 27, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
State: Triage Tickets that need to be triaged. Type: Bug
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant