I implemented a date picker in a nuxtjs with the vuetify app. It's working fine when selecting any date from the calendar. I need to enable the same functionality while typing also. If I am typing like 12122021, it should be formatted to 12/12/2021 on typing itself. Here is what I have tried so far.
https://stackblitz.com/edit/github-fms71e?file=pages/index.vue
I am getting an undefined error when I lose focus. How can I implement the functionality?
Check this codesandbox I made, I'm not using Nuxt but you can make yourself an idea to implement it on your project: https://codesandbox.io/s/stack-70724804-sryk8?file=/src/components/custom/CustomDatePicker.vue
This is a custom date picker component that I made for one of my projects. You can customize it to your needs but the component already come with multiple customization options that you can enable/modify through props.
The date picker can display dates in 3 formats. It use vue-the-mask library to control manual date inputs and some auxiliary functions to control date convertions that I import as a mixin.
Regardless of the format you choose to display to the end user, the custom date picker will always work internally with yyyy-MM-dd or yyyy-MM date format