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

[Bug] 1st of month defaultValue often shows up as previous month depending on timezone. #39

Open
AndrewMacNaughton opened this issue Apr 19, 2023 · 2 comments · May be fixed by #40
Open

Comments

@AndrewMacNaughton
Copy link

AndrewMacNaughton commented Apr 19, 2023

Vue2-datepicker version: "[email protected]"
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)

@Karan9615-off
Copy link

@mengxiong10 How can we fix the issue ?

@AndrewMacNaughton
Copy link
Author

You can create a fork and use the patch/fix I linked above. Sadly my PR never get merged.

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.

2 participants