[Vuejs]-Vue.js not displaying date in input

0👍

Select a date with datepicker and see the changes in your data. You will see the output in format ‘yyyy-mm-dd’.
You must format your date. For this, you can split your time string to parse date only.

yourDateStr = yourDateStr.split('T')[0]; //if your date is "2022-02-06T23:00:00Z" format

Parsing with new Date(yourDateStr) will cause you trouble setting the right time zone. So, if you want a simple solution you could do just parse the date.

Leave a comment