Repository navigation
Description
Bug report
Summary
I have error when setting minimum and maximum dates. the datepicker works the first time ok, but the second time you use it (open the modal) with different min and max dates it breaks and gives error message:
Unexpected error occured
Apologies..The app will close now
Please restart the app
Unable to set a visible month that is before the minimum or after the maximum date.
"4 AppName.debug.dylib
0x0000000108082a6c
_ZL22FIRCLSTerminateHandlerv +
520",
"5 libc++abi.dylib
0x000000018028e150
_ZSt11_terminatePFVVE + 12",
"6 libc++abi.dylib
0x000000018028e100
_ZSt9terminatev + 52",
"7 libdispatch.dylib
0x000000018016cd50
_dispatch_client_callout + 36",
"8 libdispatch.dylib
0x000000018017bb24
_dispatch_main_queue_drain + 1272")
I'm using react-native-modal-datetime-picker which uses react-native-datetimepicker underneath it, so I think this might be the actual place for issue. Please do correct me if that is not the case.
Reproducible sample code
Steps to reproduce
- …
- …
Describe what you expected to happen:
- …
- …
Environment info
npx react-native info output:
info Fetching system and libraries information...
System:
OS: macOS 15.5
CPU: (10) arm64 Apple M1 Max
Memory: 103.73 MB / 32.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 22.2.0
path: ~/.nvm/versions/node/v22.2.0/bin/node
Yarn:
version: 4.7.0
path: ~/.nvm/versions/node/v22.2.0/bin/yarn
npm:
version: 10.7.0
path: ~/.nvm/versions/node/v22.2.0/bin/npm
Watchman:
version: 2024.12.02.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.16.2
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 24.5
- iOS 18.5
- macOS 15.5
- tvOS 18.5
- visionOS 2.5
- watchOS 11.5
Android SDK:
API Levels:
- "23"
- "24"
- "25"
- "30"
- "31"
- "33"
- "34"
- "35"
- "36"
Build Tools:
- 23.0.3
- 24.0.3
- 26.0.3
- 28.0.3
- 30.0.3
- 31.0.0
- 32.0.0
- 33.0.0
- 33.0.1
- 33.0.2
- 34.0.0
- 35.0.0
- 36.0.0
- 36.0.0
- 36.0.0
System Images:
- android-23 | ARM 64 v8a
- android-23 | Google APIs ARM 64 v8a
- android-24 | ARM 64 v8a
- android-24 | Google APIs ARM 64 v8a
- android-25 | ARM 64 v8a
- android-25 | Google APIs ARM 64 v8a
- android-26 | ARM 64 v8a
- android-28 | Google ARM64-V8a Play ARM 64 v8a
- android-31 | ARM 64 v8a
- android-31 | Google APIs ARM 64 v8a
- android-31 | Google Play ARM 64 v8a
- android-33 | Google APIs ARM 64 v8a
- android-33 | Google Play ARM 64 v8a
- android-34 | Google Play ARM 64 v8a
- android-35 | Google Play ARM 64 v8a
- android-36 | Google Play ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2025.1 AI-251.26094.121.2512.13991807
Xcode:
version: 16.4/16F6
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.10
path: /usr/bin/javac
Ruby:
version: 3.4.1
path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
"@react-native-community/cli":
installed: 15.0.1
wanted: 15.0.1
react:
installed: 19.0.0
wanted: 19.0.0
react-native:
installed: 0.78.3
wanted: 0.78.3
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: true
info React Native v0.81.1 is now available (your project is running on v0.78.3).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.81.1
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.78.3&to=0.81.1
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".
Time zone name (If the problem you have is related to unexpected time / date. See list in https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
datetimepicker version:
"react-native-modal-datetime-picker": "18.0.0"
"@react-native-community/datetimepicker": "^8.3.0"
iOS / Android version: iOS 17.2
Activity
MuhammadUsman786786 commentedon Sep 5, 2025
In my case, crash was happening because
Because i was having the 2 picker on the same screen,
and to one picker i was passing the minDate only and to the 2nd picker i was passing the max date only
MuhammadUsman786786 commentedon Sep 5, 2025
this this confit it was crashing
display = 'default';i set the
display = 'spinner';and crash goneArviinM commentedon Sep 6, 2025
this is a good temporary fix but yes using the default display crashes the app.
Crare commentedon Sep 8, 2025
Yes we had similar issue. There is two input fields, one for start date and one for end date for a period of time to be given. this uses two of these modal components. it has min and max date ranges set based on the start date. if start date changes, max-date for the end-date-input needs to be update n-days forward.
yonitou commentedon Sep 11, 2025
Same issue
Junveloper commentedon Nov 20, 2025
Hi there, we have the exact same form structure as you described and experiencing this issue. Would you mind guiding me through how you solved this?
usmanindustryis commentedon Nov 20, 2025
As I mentioned above change the display prop to spinner, it should be fixed
jfonsecarivera commentedon Nov 28, 2025
@usmanindustryis Saying "don't use this feature" is not a "fix"
jfonsecarivera commentedon Nov 28, 2025
also, please fix
Junveloper commentedon Nov 29, 2025
@vuciv The issue has been fixed from #1026