Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.7.1
-
None
Description
Calendar.clearTime() fails if the time part of the date is in the afternoon.
The gdk seems to be doing:
self.clear(Calendar.HOUR_OF_DAY); self.clear(Calendar.HOUR);
I think that second line is unnecessary and breaking things.
Some test code:
// clearTime works for times in the morning def morning = GregorianCalendar.getInstance() morning.set(Calendar.AM_PM, Calendar.AM) morning.clearTime() assert morning.get(Calendar.HOUR_OF_DAY) == 0 // clearTime fails for times in the afternoon def afternoon = GregorianCalendar.getInstance() afternoon.set(Calendar.AM_PM, Calendar.PM) afternoon.clearTime() assert afternoon.get(Calendar.HOUR_OF_DAY) == 0 // fails in Groovy 1.7.1