I am using https://www.npmjs.com/package/vue-multi-date-picker in my vuejs code
I want to know when I edit the form How to show selected dates in datepicker text.
for example I am using
<m-date-picker
v-model="date"
:lang="lang"
:multi="multi"
:always-display="false"
:format="formatDate"
data-parsley-required="true"
:class="{
'is-invalid':
submitted &&
$v.date.$error
}"
>
</m-date-picker>
export default {
name: "newspaper-result",
components: {
editor: Editor // <- Important part
},
data() {
return {
multi: true,
lang: "en",
date: [],
notClassified: true,
submitted: false
};
},
methods: {
formatDate(date) {
return date.toLocaleDateString();
},
}
Now when I insert the date in this.date = date come from db gives error that date.toLocaleDateString(); is not a function
when I edit
? Did you add thisdata () { return { multi: true, date: [] } }
code to the component? – Sowmyadhar Gourishettywhen I edit
?² – Darlan D.https://stackoverflow.com/help/how-to-ask
or down vote – Darlan D.