Hi, I've been looking at DataField and it has a few problems mostly how it dealing with format string parsing in stringToDate and dateToString static methods.
There are several unresolved JIRA issues around this component. Some of the issues include. 1. Poor support of "M" and "D" vs "MM" and "DD". Currently: 1/10/2013 formatted with D/M/YY = null 1/10/2013 formatted with D/MM/YY = null 1/10/2013 formatted with M/D/YY = null 7/17/69 formatted with M/D/YY = null 1/30/13 formatted with M/D/YY = null And also this - which is just plain wrong! It should either reject the format as being invalid or be able to deal with it. Tue Oct 1 00:00:00 GMT+1000 2013 formatted with D/M/YY = 1/1013 Thu Jul 17 00:00:00 GMT+1000 1969 formatted with M/D/YY = 7/1769 Thu Jul 17 00:00:00 GMT+1000 1969 formatted with D/M/YY = 177/69 Tue Oct 1 00:00:00 GMT+1000 2013 formatted with M/D = 1001 2. Invalid formatting of invalid dates Invalid Date formatted with DD/MM/YYYY = NaN/NaN/NaN 3. Magic cut off in 1970. 7/17/71 formatted with MM/DD/YYYY = Sat Jul 17 00:00:00 GMT+1000 1971 7/17/69 formatted with MM/DD/YYYY = Wed Jul 17 00:00:00 GMT+1100 2069 I've rewritten the methods in a cleaner way that support a wider range of formats and fixes all the issue above. The code is in the style of the existing SDK code (which is a little ugly IMO). Any feedback,potential bug etc etc would be appreciated. There a bit more work to do with stringToDate and support for formats without separators - which might be tricky. The mustella DateField tests all pass however I believe it only tests the US centric MM/DD/YYYY format. [java] ===================================================== [java] Passes: 327 [java] Fails: 0 [java] ===================================================== Thanks Justin