Hi Folks,
i am working on a gui for my database, which is supposed to store archaeological data. For this reason dating is a crucial part of it. To do this, i like to use the SQL Date type and in my backing bean the java.util.calendar. Both allow datings before Christ.
The fields now look like this:
As you can see, im using Pattern instead of style. This offers me the opportunity to use datings like 01.31 BC or 01.14 AD. But for some reason, if i chance the pattern into this:Code:@Past @Temporal(TemporalType.DATE) @DateTimeFormat(pattern = "M.Y G") private Calendar begining; @Past @Temporal(TemporalType.DATE) @DateTimeFormat(pattern = "M.Y G") private Calendar ending;The Day is parsed wrong. If i type into my field, 01.01.31 BC and submit it to the database it changes to 05.01.31 BC. But the mistake don't happends in the Database, its the calendar object, which contains wrong data. So, somewhere between my input field and the backing-bean, something went wrong. Know i am asking you, where and why?Code:@DateTimeFormat(pattern = "d.M.Y G") or @DateTimeFormat(pattern = "dd.M.Y G")
And there is another quit annoying behavior of roo if you use patterns. To represent dates, roo uses in the jspx file fmt:dateformat, and therefor you'll need a pattern, which is inserted in the controller into the modelMap. By default roo uses styles, if you now switch to pattern, roo deletes the variable in the controller, but not in the jspx, so as it turned out, nothing will be shown. If you insert the variables in question, roo deletes them from time to time, again. I guess this is intended and very usefull in normall circumestances, but how i turn this off?
Thank you for your answers in advance,
regards
Nils


Reply With Quote