If you want to set default value of date, convert it to Date first using new Date(val).
An error occurs during
{{ slotProps.componentField.modelValue ? df.format(slotProps.componentField.modelValue.toDate(getLocalTimeZone())) : "Pick a date" }}
because slotProps.componentField.modelValue is of type string and not a DateValue like expected by Calendar component.
That's because radix-vue's Date Picker uses @internationalized/date only. I'm facing the same issue. I can't set initial values because of that, and Zod doesn't support such objects.
Reproduction
https://stackblitz.com/edit/nuxt-vue-3-4-beta-twkyrr?file=src%2Fpages%2Fhome%2FHomePage.vue
Describe the bug
In documentation:
An error occurs during
{{ slotProps.componentField.modelValue ? df.format(slotProps.componentField.modelValue.toDate(getLocalTimeZone())) : "Pick a date" }}
because slotProps.componentField.modelValue is of type string and not a DateValue like expected by Calendar component.
System Info
Contributes