Answer the question
In order to leave comments, you need to log in
How to change date format for input date?
There is a date input field:
<input class="datapicker" v-model="docData.FacturaDoc.FacturaDate" :placeholder="$t('documents.headers.DATE')" type="text" onfocus="(this.type='date')" onblur="(this.type='text')">
Answer the question
In order to leave comments, you need to log in
You don't need a mask on the date. The field value is always in international format regardless of locale settings.
And to get the date
<input type="date" />
HTMLInputElement.value // 2020-03-06
new Date(HTMLInputElement.value) // Date Fri Mar 06 2020 02:00:00 GMT+0200
new Date(1583366400000) // Date Thu Mar 05 2020 02:00:00 GMT+0200
new Date("2020-03-05") // Date Thu Mar 05 2020 02:00:00 GMT+0200
new Date("05.03.2020") // Invalid Date
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question