vue3-datepicker
vue3-datepicker copied to clipboard
typable: formating before I finish typing the date.
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)
This is also happening to me, do you have any workaround? I really need to use a datepicker in my company project
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 ;)
I am also facing similar issue. Is there a ETA for a fix on this issue.
Fixed in https://github.com/icehaunter/vue3-datepicker/pull/61 (since v0.3.2)