If a Calendar changes values, update the (cached) fields.

This commit is contained in:
Eric Scharff 2007-10-22 12:23:56 -06:00
parent 8902cf2a73
commit 7eb08c5fc4

View File

@ -76,6 +76,11 @@ public abstract class Calendar {
parseIntoFields(time);
}
public void setTime(Date date) {
super.setTime(date);
parseIntoFields(this.time);
}
private static boolean isLeapYear(int year) {
return (year%4 == 0) && (year%100 != 0) || (year%400 == 0);
}