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

The dates appear under the incorrect days in the datetime picker #48

Open
nehay578 opened this issue Sep 25, 2017 · 5 comments
Open

The dates appear under the incorrect days in the datetime picker #48

nehay578 opened this issue Sep 25, 2017 · 5 comments

Comments

@nehay578
Copy link

screen shot 2017-09-25 at 1 20 48 pm
As seen in the screenshot, today's date is 25th Sep, which is Monday, but the datetime picker shows 25th Sep under tuesday.

@nehay578
Copy link
Author

However, the date is correct in the picker in the live demos here: https://www.npmjs.com/package/angularjs-datetime-picker

@tomsoderlund
Copy link

This seems related to US “start weeks with Sunday” vs. Europe “start weeks with Monday”. Anyone know of a fix? @nehay578

@vz28bh
Copy link

vz28bh commented Feb 19, 2020

This is kind of a critical bug...anyone looked at it?

@vz28bh
Copy link

vz28bh commented Feb 19, 2020

I did some investigation, angular/angular.js#11900, problem is that angular and javascript disagree on which day is 0. JavaScript Sunday=0, Angular $locale says Monday=0. So...if you change line 160 like this it fixes the problem:

firstDayOfWeek = ($locale.DATETIME_FORMATS.FIRSTDAYOFWEEK+1)%7 || 0;

@maubarrerag
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants