Vuepic / vue-datepicker

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

UTC model type #930

Open faizaaulia opened 1 week ago

faizaaulia commented 1 week ago

Describe the bug utc prop is true and model-type is set to yyyy-MM-dd HH:mm:ss, but the model value format is not yyyy-MM-dd HH:mm:ss, it returned an ISOString instead

To Reproduce Steps to reproduce the behavior:

  1. Go to https://stackblitz.com/edit/vuepic-vue-datepicker-8pjnev?file=src%2Fcomponents%2FPlayground.vue
  2. Pick a date on the first input, the value format is not match with the model-type prop value
  3. Pick a date on the second input, the value format will match the model-type prop value

Expected behavior If the utc set to true, and model-type set to yyyy-MM-dd HH:mm:ss the expected model value is like the result on the second input

I'm not really sure if it's a bug or because it's not possible...

Screenshots image