Hello!
Using
-
Angular 7 with jsonforms/core@2.3.0 / jsonforms/angular-material@2.3.0
-
Angular 9 with jsonforms/core@2.4.0 / jsonforms/angular-material@2.4.0
Given a very simple data object and schemas
{ "today": "" }
{
"type": "object",
"properties": { "today": { "type": "string", "format": "date" } }
}
{
"type": "VerticalLayout",
"elements": [{ "type": "Control", "scope": "#/properties/today" }]
}
Expectation 1 (Possibly a Bug - possibly me not finding the correct documentation)
- When I pick a date (for example 9/1/2020 (US format)) that the date displayed is 9/1/2020.
Reality
-
When I pick a date, the date that is displayed is the PRIOR day.
-
I assume this is a locale issue, but I am not sure how to fix this.
Expectation 2 (Error condition)
- When I remove the date from the input box that there are no errors
Reality
-
When I delete the date from the input box I get
Cannot read property ‘toISOString’ of null
-
This is because in the DateControlRenderer this line is not checking for a valid value in event.value:
-
getEventValue = (event: any) => event.value.toISOString().substr(0, 10);
Please advise on how to resolve these issues. I don’t currently see issues reported for these items on github, so if they are bugs I can open an issue.
Thanks so much!!
[original thread by Thad Peiffer]