Closed
Description
The 'value' of the v-model in the datepicker component is initialized as:
{ form.data_registrazione: null }
and then it is set as Date
:
this.form.data_registrazione = DateTime.fromISO(response.data.data_registrazione).toJSDate()
This is the template:
<b-form-datepicker
v-model="form.data_registrazione"
locale="it-IT"
start-weekday=1
hide-header
value-as-date
:date-format-options="{ year: 'numeric', month: 'numeric', day: 'numeric' }"
placeholder="Data operazione..."
ref="data_registrazione"
:disabled="setDisabledStatus('data_registrazione')"
/>
As soon as I mount the component containing the template above, I get the following warning:
[Vue warn]: Invalid prop: type check failed for prop "value". Expected String with value "Tue Dec 01 2020 00:00:00 GMT+0100 (Central European Standard Time)", got Date
found in
---> <BVFormBtnLabelControl>
<BFormDatepicker>
<BFormGroup>
<ValidationProvider>
<DatiRegistrazione>
<BTab>
<ValidationObserver>
<BTabs>
<ValidationObserver>
<Registrazione> at src/components/registrazione/Registrazione.vue
<App> at src/App.vue
<Root>
Any hints on how to get rid of it?
Many thanks in advance.