-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS TimePicker - default date actually return the launch date #578
Comments
Hey @rewieer ! :D Can't test it now, but I'm wondering...
Does the returned value not match what is shown in the UI? |
Hey :D |
I'm getting the same issue. |
I am having the same issue but resolved by the below code <DateTimePickerModal |
Returning one day less on IOS but working fine on Andorid. |
Basically It's returning time in 24 hours format .
below is my onChangeDate function where I handled this issue.
Now It's Working fine. |
Having the same issue. Any updates on this? |
I was facing the same issue but I've come up with a solution. In the callback function for onConfirm, custom logic is dependent on the minuteInterval
Hope this helps :) |
add date={new Date()} return ( |
I have the same issue. How do I fix it? |
Environment
System:
OS: macOS 11.1
CPU: (20) x64 Intel(R) Core(TM) i9-10910 CPU @ 3.60GHz
Memory: 1.48 GB / 32.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 12.19.0 - ~/.volta/tools/image/node/12.19.0/bin/node
Yarn: 1.22.5 - ~/.volta/tools/image/yarn/1.22.5/bin/yarn
npm: 6.14.8 - ~/.volta/tools/image/node/12.19.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
Android SDK: Not Found
IDEs:
Android Studio: 4.2 AI-202.7660.26.42.7351085
Xcode: 12.5/12E262 - /usr/bin/xcodebuild
Languages:
Java: 14.0.2 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: Not Found
react-native: Not Found
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Platforms
iOS
Versions
10.0.0
Description
When using the time picker using an interval (for example 30 minutes), whenever the user clicks "OK" without changing the date, it return the locally cached time.
For a DatePicker it's usually not a problem (unless the user starts the app at 11.45 PM and launches the picker at 0.10 AM the next day for example, but it's a edge case) but for the TimePicker it is because it doesn't return the correct hour.
One solution would be to generate a new date whenever the modal opens up. In the case of the time picker on iOS, we'd need to draw an algorithm that generate the closest date using the current time and the interval as a constraint. It seems this bug is deep inside the iOS picker itself.
Reproducible Demo
Something as simple as this should do.
The text was updated successfully, but these errors were encountered: