vuejs-datepicker icon indicating copy to clipboard operation
vuejs-datepicker copied to clipboard

Issue with format and typeable

Open Andyc751 opened this issue 4 years ago • 4 comments

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

Andyc751 avatar Apr 24 '20 15:04 Andyc751

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

n-smits avatar Apr 25 '20 21:04 n-smits

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.

vuejs-datepicker-issue

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.

Andyc751 avatar Apr 27 '20 01:04 Andyc751

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()) },

ghost avatar Apr 15 '21 16:04 ghost

I just encountered the same issue as reported by @Andyc751

anishthecoder avatar Oct 20 '22 01:10 anishthecoder