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

Day in month table no marked as active, when using moment.timezone #48

Open
stereonom opened this issue Apr 23, 2021 · 1 comment · May be fixed by #49
Open

Day in month table no marked as active, when using moment.timezone #48

stereonom opened this issue Apr 23, 2021 · 1 comment · May be fixed by #49

Comments

@stereonom
Copy link

Hi!

The problem is this line
let currentDayModel = new Date(currentYear, dayMonth - 1, day)

let currentDayModel = new Date(currentYear, dayMonth - 1, day)

Because after that u are using the moment-adapter to compare currentDayModel with min and max using isSameOrAfter / isSameOrBefore

When moments timezone is set to another timezone, the day u are comparing is not on the day currentDayModel is.

@stereonom
Copy link
Author

stereonom commented Apr 26, 2021

I found a solution:

let currentDayModel = new Date(Date.UTC(currentYear, dayMonth - 1, day));

@stereonom stereonom linked a pull request Apr 26, 2021 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant