Vuepic / vue-datepicker

Datepicker component for Vue 3
https://vue3datepicker.com
MIT License
1.48k stars 147 forks source link

Automatic Delimiter Input Option #784

Closed Kagayakashi closed 6 months ago

Kagayakashi commented 7 months ago

We are using your component on Production system. When user manually inputting dates and times, it can be inconvenient to remember to add separators between date and time components. This becomes even more challenging when considering the need to switch keyboard layouts, where keys might represent different characters.

We would like to propose adding an option that automatically inserts separators based on the specified format.

For instance, with the format "yyyy-MM-dd HH:mm:ss", if a user enters digits "20240318144028" via keyboard input, the system would dynamically transform it to "2024-03-18 14:40:28" as the user types. This ensures a seamless input experience, with separators added on the fly as needed.

Jasenkoo commented 6 months ago

There is no need for a separate option, as you can pass multiple formats for text-input, e.g.

:text-input="{ format: ['yyyy-MM-dd HH:mm:ss', 'yyyyMMddHHmmss'] }"

With this, you can input the date in both ways.