eclipsesource / eclipsesource/jsonforms

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

Open
#1,711 1 comment 0 reactions 0 assignees View on GitHub
enhancement material react
Dominant language
TypeScript
Stars
2.7k
Forks
424
Avg merge
17d 8h
Merged PRs (30d)
1

Description

**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](https://user-images.githubusercontent.com/54800010/110152031-7f318f00-7de1-11eb-90fa-1f0562648f1b.png)

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.