vue-rangedate-picker icon indicating copy to clipboard operation
vue-rangedate-picker copied to clipboard

January 1, 2019 fell on a Tuesday

Open paatrick opened this issue 6 years ago • 2 comments

Hello,

January 1, 2019 fell on a Tuesday

In the component this appears as Monday

screen shot 2019-01-08 at 15 34 25

paatrick avatar Jan 08 '19 17:01 paatrick

this can be fixed by changing startNextMonthDay on rangedate-picker.js for

if (this.startNextActiveMonth > 0) {
  return new Date(this.activeYearStart, this.startNextActiveMonth, 1).getDay()
} else {
  return new Date(this.activeYearStart + 1, this.startNextActiveMonth, 1).getDay()
}

I´ll send a PR

loama avatar Jan 16 '19 02:01 loama

We fixed this by adjust all the Date.UTC(...) nonsense that is going on.

return new Date(Date.UTC(this.activeYearStart, this.startNextActiveMonth, 1)).getDay(); // fails

return new Date(this.activeYearStart, this.activeMonthStart, 1, 0, 0, 0).getDay(); // good

touchstorm avatar Sep 19 '19 19:09 touchstorm