Skip to content

Different behaviour on field of type string with format date in array of objects vs object #1711

Open
@Link631

Description

@Link631

Describe the bug

Given is following schema where one date property is in the root object and another date property is nested inside a list of objects

schema = {
type: "object",
properties: {
validators: {
type: "array",
items: {
type: "object",
properties: {
name: {
type: "string",
title: "Name",
description: "Name"
}
},
required: ["name"]
}
},
currentUserCanValidate: {
title: "Aktueller Benutzer ist validator?",
type: "boolean"
},
validations: {
type: "array",
items: {
type: "object",
properties: {
validationDate: {
title: "date in array of objects",
type: "string",
format: "date"
},
validatedBy: {
title: "validiert von",
type: "string"
}
},
required: ["validationDate", "validatedBy"]
}
},
nextValidation: {
type: "string",
title: "date in object",
format: "date"
}
}
};

When I use react with material renderer, then I expect, that the formats in UI and the presentation of the DateField is in both cases the same, but it renders different formats:

To Reproduce
Copy the schema and render the form.
Expected behavior
The date controls schould look the same and not differnt

Screenshots
image

Further questions:

How can i influence the UI Format? I know that the json schema date is per specification in format yyy mm dd... but I guess that the UI can render differently while just storing the date in that format.

Do you have working examples which show how to change the date format in ui?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions