Fixing an issue for 2100.
Bug:
28784177
Test: build only
Change-Id: I4579ba2d07b8157f368fd31df5396677156aeeb0
return DatePicker.class.getName();
}
- public static int getDaysInMonth(int month, int year) {
+ private static int getDaysInMonth(int month, int year) {
switch (month) {
case Calendar.JANUARY:
case Calendar.MARCH:
case Calendar.NOVEMBER:
return 30;
case Calendar.FEBRUARY:
- return (year % 4 == 0) ? 29 : 28;
+ return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) ? 29 : 28;
default:
throw new IllegalArgumentException("Invalid Month");
}