sumcumo / vue-datepicker

A datepicker Vue component. Compatible with Vue 2.x.
https://sumcumo.github.io/vue-datepicker/
Apache License 2.0
75 stars 22 forks source link

Fix UTC issues #178

Closed mst101 closed 1 year ago

mst101 commented 2 years ago

Turns out there were a couple of issues with UTC dates:

  1. Today's date/month/year may not be highlighted correctly as we are always comparing the cells' date with a local date. We can avoid this by using getNewDateObject() which takes into account the value of use-utc.

  2. When parsing a typed date on 1st January, there is a remote chance of getting the wrong default year as we're using new Date.getFullYear() instead of the UTC-sensitive equivalent.

This PR also tidies up the code that generates the cells in the various pickers by relying on the fact that pageDate will be UTC-sensitive.

MrWook commented 1 year ago

@mst101 i merged the update branch. Could you resolve the merge conflicts in all your MR's :/ ?

mst101 commented 1 year ago

OK thanks, done that.

You should be able to work through them from here in numerical order - except for the feat/vue3 branch which is rebased off #190.

MrWook commented 1 year ago

Are you sure the conflicts are still there 🤔