TAP5-1998: DateField does not validate properly

  1. month-of-tapestry
  2. tapestry
  3. java
  4. www

TAP5-1998, DateField does not validate dates properly, has just been fixed.

Before the fix, all handling of dates by Tapestry, including DateField conversions of String to Date and coercion from String to java.text.DateFormat was lenient. For example, it parsed 00/01/2000 as 12/01/1999. For more details on DateFormat leniency, check DateFormat's JavaDoc.

The fix adds a new Tapestry configuration symbol, SymbolConstants.LENIENT_DATE_FORMAT (tapestry.lenient-date-format) symbol with a default value of false. In addition, now DateField has a new parameter, lenient, which defines whether that component should treat dates leniently. Its default value comes from the symbol above.

So, if you want to have the old Tapestry behavior and treat dates leniently, just set SymbolConstants.LENIENT_DATE_FORMAT to false.

Month of Tapestry progress

Hours worked so far
29.5 out of 160 (18%)
Issues fixed
3

Comments: 0

You need to be logged in to post a comment.