dpicker
dpicker copied to clipboard
Day in month table no marked as active, when using moment.timezone
Hi!
The problem is this line
let currentDayModel = new Date(currentYear, dayMonth - 1, day)
https://github.com/soyuka/dpicker/blob/ce8d2aa11b599051278d107ccccbe08e48a09e7b/src/dpicker.js#L507
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.
I found a solution:
let currentDayModel = new Date(Date.UTC(currentYear, dayMonth - 1, day));