Dates rendering in default format instead of UK format

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:

“dob”: {
“type”: “string”,
“format”: “date”
}

And in the UI schema like this:

{
“type”: “Control”,
“scope”: “#/properties/dob”,
“label”: “Date of Birth”,
“dateFormat”: “DD-MM-YYYY”,
“dateSaveFormat”: “DD-MM-YYYY”
}

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 !

Kind regards.

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.

Here’s what it should look like in the UI Schema:

{
“type”: “Control”,
“scope”: “#/properties/dob”,
“label”: “Date of Birth”,
“options”: {
“format”: “date”,
“dateFormat”: “DD-MM-YYYY”,
“dateSaveFormat”: “DD-MM-YYYY”}
}

Hi @bowenp01,

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.

Thanks for the compliments :slight_smile: