Closed omixer closed 11 years ago
Thanks for the tipp. I played around with your solution and it works but this approach would also make dates before the year 1000 invalid. Maybe the best solution would be to check the date on the page using javascript or in a Controller.
Based on your suggestion I made a new section "developer notes" in the description.
Hi Joerg,
This is more a request than a bug. The registered StructuredDateEditor accepts this date 01/02/20135 even if the specified default.date.format is dd/MM/yyyy. Validation goes well but when I save the instance holding this date I get the following exception:
MysqlDataTruncation: Data truncation: Incorrect datetime value: '20135-02-01 00:00:00'
I would either add this to the documentation so developers can decide how to handle it and avoid surprises or change the code to use StructuredDateEditor(DateFormat dateFormat, boolean allowEmpty, int exactDateLength) instead of StructuredDateEditor(DateFormat dateFormat, boolean allowEmpty) :
For more on this issue check: https://jira.springsource.org/browse/SPR-1049
Note that I am using version 0.6.1b (though i don't think is makes a difference if I update to the latest version)
Thank you.