diff options
author | Neil Fuller <nfuller@google.com> | 2019-04-17 15:57:04 +0100 |
---|---|---|
committer | Neil Fuller <nfuller@google.com> | 2019-04-17 18:09:20 +0100 |
commit | f29bf1f9342b7991dcbfd828c65614c33f964b42 (patch) | |
tree | e626936d2c10487db6cd1439bf6d30b50699ab72 | |
parent | b38a37cb1ca2fba2c65a744d774bb382e10cd886 (diff) | |
download | datetimepicker-f29bf1f9342b7991dcbfd828c65614c33f964b42.tar.gz |
Fix incorrect leap year logic
Fixing an issue for 2100.
Bug: 28784177
Test: build only
Change-Id: I7fc324445c79c881994cfdded9685c156efe5538
-rw-r--r-- | src/com/android/datetimepicker/Utils.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/datetimepicker/Utils.java b/src/com/android/datetimepicker/Utils.java index 6c0adbe..cf3df7c 100644 --- a/src/com/android/datetimepicker/Utils.java +++ b/src/com/android/datetimepicker/Utils.java @@ -77,7 +77,7 @@ public class Utils { 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"); } |