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.
Summary
Fixes #30
The fix requires calling the
setDate
twice:I've tried with only a single call or different not generating a copy of the date, but was only able to resolve it with this combination. These steps are wrapped in the method
resetDate
which gets called fromwillMoveToSuperview
(the view may be displayed, so we're going to perform this resetDate here) and after theonChange
handler is called and if we're using the countdown mode.Test Plan
What's required for testing (prerequisites)?
A DateTimePicker component with
'countdown'
mode running on an ios device or simulator:What are the steps to reproduce (after prerequisites)?
Bug 1
onChange
handler to produce visible outputBug 2
Compatibility
This is an ios only bug. It shouldn't affect the existing android implementation.
Checklist
README.md
example/App.js
)