Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rleecrewmp's avatar

Date picker and VueJS

In my application, I have a date property that is bound with a date input. Whenever I trigger the input to appear with the property value, I get

The specified value "{ { date } }" does not conform to the required format, "yyyy-MM-dd".

How do I change the format that Vue thinks is required because as far as I know, the datepicker uses the local machine's format.

And while I have you here, does VueJS support onBlur events?

0 likes
2 replies
jekinney's avatar

Which date picker are you using? Can you link to it?

Yes vue does all JavaScript events including blur.

danielwaghorn's avatar

I had a similar problem when binding dates into a date input on a form, so what I did was write a custom filter and piped the value through e.g. {{ date | ISODate }}.

My filter is below:

Vue.filter('ISODate', function (value) {
    return value.toISOString().substr(0,10);
})

The filter assumes that the value passed to it already is a Date object, however if it is a string passed from your date picker you could always modify the filter to instantiate it as a date from your given format before converting it.

Please or to participate in this conversation.