-
Bug
-
Resolution: Not an issue
-
Neutral
-
None
-
5.5.5
-
None
Configuring on a DateFieldDefintion a default value like this defaultValue: 2015-01-01 throws an exception:
Caused by: java.text.ParseException: Unparseable date: "Thu Jan 01 01:00:00 CET 2015" at java.text.DateFormat.parse(DateFormat.java:366) at info.magnolia.ui.vaadin.integration.jcr.DefaultPropertyUtil.createTypedValue(DefaultPropertyUtil.java:164) ... 137 more
The reason:
Yaml seems to automatically parse String representations of Date (and of Time).
Regarding Date:
Adding a Date value as String to the yaml defaultValue: 2015-01-01 and reading the String directly from the defintion it returns this Thu Jan 01 01:00:00 CET 2015.
When its not matching the Date formate it returns the String 1:1, for example: Adding this value to the yaml defaultValue: 2015.01.01 and reading the String directly from the defintion it returns this {2015.01.01}}.
Regarding Time:
Adding a Time value as String to the yaml example: 11:00 and reading the String directly from the defintion it returns this 660 (which is a wrong int representation!).
When its not matching the Time formate it returns the String 1:1, for example: Adding this value to the yaml example: 11.00 and reading the String directly from the defintion it returns this {11.00}}.
- relates to
-
MGNLUI-4270 DateField: Default value is not picked up on existing (but empty) field
- Closed