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

typable: formating before I finish typing the date.

Open TheNaschkatze opened this issue 4 years ago • 3 comments

When typing a date, for example 30.11.2023

the watch(input.value) triggers and formats my date. The problem is, as soon as I start writing the year (in this case number 2), I get the formatted date 30.11.0002. In other words, it formats my dates before I finish writing it.

eddit: If you need a quickfix, following will work as long as you have an inputFormat:

in the file datepicker.vue inside const keyUp you have to replace:

if (isValid(parsedDate))

with

if (isValid(parsedDate) && input.value.length === props.inputFormat.length)

TheNaschkatze avatar Aug 24 '21 16:08 TheNaschkatze

This is also happening to me, do you have any workaround? I really need to use a datepicker in my company project

Arthurin915 avatar Aug 27 '21 19:08 Arthurin915

This is also happening to me, do you have any workaround? I really need to use a datepicker in my company project

@Arthurin915 yep! Fork the repo and in the file datepicker.vue inside const keyUp you have to replace:

if (isValid(parsedDate))

with

if (isValid(parsedDate) && input.value.length === props.inputFormat.length)

this will make the trick as long as you give an inputFormat ;)

TheNaschkatze avatar Aug 30 '21 07:08 TheNaschkatze

I am also facing similar issue. Is there a ETA for a fix on this issue.

PurnimaCompro avatar Oct 25 '21 10:10 PurnimaCompro

Fixed in https://github.com/icehaunter/vue3-datepicker/pull/61 (since v0.3.2)

icehaunter avatar Jun 04 '23 15:06 icehaunter