Merge "Fix incorrect leap year logic"

am: 8b5eb92120

Change-Id: If9c70bb913abb8ef8a1dbe140ebdcbf24d2d87cf
This commit is contained in:
Neil Fuller
2019-04-18 04:22:32 -07:00
committed by android-build-merger
2 changed files with 2 additions and 2 deletions

View File

@@ -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");
}

View File

@@ -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");
}