Fixed Issue #935: Unable to select a date earlier than Unix epoch whe… #938
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…n only a maximum date is provided on Android
Summary
The error was described in #935
This pull request solves #935 . According to old code when you provide only maximum date, it gets minimum date timestamp as 0 (which is Thursday, January 1, 1970 12:00:00 AM) . As a result when you select the date before the minimum date, it selects minimum date, I am not sure whether it is a bug because I think you shouldn't select a date before minimum date if you give a value to maximum date . However, Maybe used minimumDate value can be changed here because there is a constant which is
DEFAULT_MIN_DATE
timestamp equals to-2208988800001l
in RNConstants.java. You can see the code below in RNConstants.javaAnd this constants matches 01 Jan 1990 date. My pull request only changes minDate as 01 Jan 1900, if this minDate is not provided by the user.
Test Plan
What's required for testing (prerequisites)?
You can use your physical devices or emulators for testing.
What are the steps to reproduce (after prerequisites)?
You can use the js code below for seeing the bug. You can replace example/App.js code with the code below:
Some Videos For Showing Changes
Before Changes:
https://github.com/user-attachments/assets/42a6f688-37c1-4b1d-9f17-4e84b285f35b
After Changes:
https://github.com/user-attachments/assets/673fb04f-9e8f-4f52-942e-c7af065d1d59
Compatibility
Checklist
README.md
example/App.js
)