Congratulations on an amazing package. I’m new to JSONForms and react and it’s just brilliant.
My issue is that my date-pickers are rendering dates as YYYY-MM-DD instead of DD-MM-YYYY.
I’m using version 3.5.1 of JSONforms with material-renderers and material version 7.
I’ve imported dayjs and set the global locale for the application to en-gb
In my schema I have date of birth defined like this:
I have looked at other date format related posts in this forum but I haven’t found anything that helps. Am I just being stupid ? Can anyone point me in the right direction please .. I’d be very much obliged !
OK. I’ve worked it out (finally).
For anyone struggling with the same issues, the dateFormat and dateSaveFormat need to be inside the options object in the UI Schema. Also don’t use “format”: “date” inside ‘schema’, it also needs to go in the options object in the UI schema or your date picker will be marked with an error.
The format in the JSON Schema is well defined, and specifically refers to the iso format, see here. Therefore if you use an incompatible dateSaveFormat then you need to remove the format: 'date' from the JSON Schema.