When creating a node via the REST API, it's possible to set a date with a 5-digit year (e.g. 20202-09-02) for date properties. This causes an error pop-up and UI issues in Share and is inconsistent with creating a node via the UI where a date like this is flagged as invalid.
Steps to reproduce
- Create a new node via the REST API, sending a POST request for example to
with the following data:
(Note: The observed behavior is the same whether the cm:created property or a custom date property is set to a value like this. cm:created is suggested to test this without the need for adding a custom property to the content model)
- Inspect the created node in Share and in the Node Browser
The REST API should return an error instead of creating the node, consistent with Share where the property value will not be saved when a date in this format is entered (see attached screenshot "share_error.png")
The node is created with the created date set to the year 20202, this value can be seen in the Node Browser and database (see attached screenshot "NodeBrowser.png").
When opening the document in Share, there is a pop-up saying "Failure" and none of the properties of the node are displayed (see attachments "Failure_popup.png" and "properties.png"). The share.log file shows an error similar to "Failed to parse date 20201-08-27T00:00:00.000+01:00" (see attached).