Merge "Fix incorrect leap year logic"
This commit is contained in:
@@ -597,7 +597,7 @@ class DatePickerCalendarDelegate extends DatePicker.AbstractDatePickerDelegate {
|
||||
case Calendar.NOVEMBER:
|
||||
return 30;
|
||||
case Calendar.FEBRUARY:
|
||||
return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) ? 29 : 28;
|
||||
return (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)) ? 29 : 28;
|
||||
default:
|
||||
throw new IllegalArgumentException("Invalid Month");
|
||||
}
|
||||
|
||||
@@ -850,7 +850,7 @@ class SimpleMonthView extends View {
|
||||
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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user