Handle empty dates correctly in creation/edition forms.
When an empty value is provided to the DateInput component, the state stores an empty string which is sent as is in the RQL request.
For example, when the user doesn't type a date in the following component
<DateInput source="creation_date" />
The generated RQL looks like
INSERT MyEntity X: X creation_date ''
This leads to an error in the backend:
cubicweb.web._exceptions.RemoteCallFailed: InvalidDatetimeFormat: ERREUR: syntaxe en entrée invalide pour le type date : « »
LINE 1: ...creation_date = '', ...
^
One solution is to provide a parse
and a format
prop to each DateInput which would convert from/to ''/null. But a better solution could be to make this conversion directly in the DataProvider.