[Bug] 1st of month defaultValue often shows up as previous month depending on timezone.
Opened this issue · 2 comments
Vue2-datepicker version: "vue-datepicker-next@1.0.2"
Vue version: 3.2.45
Browser: Chrome
Steps to reproduce
<date-picker name="dueDate" format="YYYY-MM-DD" value-type="YYYY-MM-DD" defaultValue="2023-07-01" :value="dueDate" @change="handleDateChanged" />
When you open the date picker in North America it defaults to the June Calendar month not July. This however works as expected in Australia. I'd guess its a timezone thing, but not sure how to solve on our end. I checked through all the closed issues and couldn't see something like this already.
Edit to add: You can test this in Chrome Dev Tools by clicking the 3 dots, more tools, sensors, and set the location override to San Fransisco.
Reproduction Link or Source Code
https://codesandbox.io/s/patient-meadow-gkuppz?file=/src/App.vue:61-98
Expected behavior
Opens to July in all locations/timezones
Actual behavior
Opens to June in North America (PST)
@mengxiong10 How can we fix the issue ?
You can create a fork and use the patch/fix I linked above. Sadly my PR never get merged.