vuejs-datepicker
vuejs-datepicker copied to clipboard
Issue with format and typeable
I am having a problem using format with typeable
I have these two attributes set: format="'yyyy-MM-dd'" typeable="true"
Selecting the date with the picker works fine, it does format the date correctly.
When the date is typed in, the date picker is choosing the previous date. Example: If I type 2020-04-10, the date picker selects 2020-04-09
Here is a fiddle to demonstrate https://jsfiddle.net/6jmwszcv/
Note: If I remove the format and just use typeable, the typed in date does pick the correct date.
Thanks
Can't reproduce Andyc's problem (on fiddle)? Picks the correct date for me; with format="'yyyy-MM-dd'"
and with format='yyyy-MM-dd'
and with no format. Using chrome on macos
Just re-tested the fiddle on 2 separate windows 10 machines, as well as Edge, Chrome, Firefox and Safari (iPhone 8) with the same result.
Here is the image just after I finished typing the last "0" from the date 2020-04-20. The input shows 2020-04-20, but the actual date picker shows 2020-04-19, and if you bind a vue data field to this it also will be 2020-04-19.
Could it have something to do with the timezone ? I'm UTC -5.0 The Short Date on my machine is also YYYY-MM-DD, on Windows 10.
We cannot use this in production because of this bug.
is the issue related to this method in datepicker.vue? it's setting the date from the milliseconds and local time is converted to ISO time.
setTypedDate (date) { this.setDate(date.getTime()) },
I just encountered the same issue as reported by @Andyc751