From 722807a9edabc0b5f57d935c30b0abf924bb8de4 Mon Sep 17 00:00:00 2001 From: huymobile Date: Sat, 3 Oct 2026 02:23:44 +0700 Subject: [PATCH] fix(android): allow dates before 1970 when only maximumDate is set When only maximumDate is provided, the date change listener clamps the selected date between minDateWithTimeZone and maxDateWithTimeZone. Without a minimumDate, minDateWithTimeZone returned 0 (the Unix epoch), so any earlier date snapped back to 1970-01-01. Return Long.MIN_VALUE instead, mirroring maxDateWithTimeZone returning Long.MAX_VALUE when maximumDate is not set. Co-Authored-By: Claude Opus 5.5 --- .../main/java/com/reactcommunity/rndatetimepicker/Common.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/com/reactcommunity/rndatetimepicker/Common.java b/android/src/main/java/com/reactcommunity/rndatetimepicker/Common.java index a854edc8..104a1814 100644 --- a/android/src/main/java/com/reactcommunity/rndatetimepicker/Common.java +++ b/android/src/main/java/com/reactcommunity/rndatetimepicker/Common.java @@ -213,7 +213,7 @@ public static long maxDateWithTimeZone(Bundle args) { public static long minDateWithTimeZone(Bundle args) { if (!args.containsKey(RNConstants.ARG_MINDATE)) { - return 0; + return Long.MIN_VALUE; } Calendar minDate = Calendar.getInstance(getTimeZone(args));