koumoul-dev / vuetify-jsonschema-form

Create beautiful and low-effort forms that output valid data. Published on npm as @koumoul/vjsf.
https://koumoul-dev.github.io/vuetify-jsonschema-form/latest/
MIT License
539 stars 154 forks source link

[SOLVED] How to set the date to be default format YYYY-MM-DD? #224

Open Mashiane opened 3 years ago

Mashiane commented 3 years ago

Hi there

for the format-date, how do I set the date to be in yyyy-mm-dd format?

Thanks

albanm commented 3 years ago

Hello,

In the model the date will always be stored using the iso format, otherwise the json schema would not validate.

If you are talking about the format that is shown to the user, it is based on the current locale but you can customize it by replacing the formatting function (https://koumoul-dev.github.io/vuetify-jsonschema-form/latest/configuration).

Mashiane commented 3 years ago

Thank you, yes I want to format the value that is displayed. I want to use something like moment.js or day.js to format the dates.

I will look into the functions.