react-native-datetimepicker / datetimepicker

React Native date & time picker component for iOS, Android and Windows
MIT License
2.51k stars 406 forks source link

Android Time Picker Spinner has unexpected behavior when the time interval is set to 30 minutes #822

Open k-henning opened 1 year ago

k-henning commented 1 year ago

When using an Android device with the time picker displaying a spinner and set to a 30 minute interval the hour slot is moving unexpectedly.

If my time picker is currently set to 8:00 PM and I move the minutes section to be 30 my result is 7:30 PM while my expected result should be 8:30PM.

In order to reproduce you must be on Android and your minute interval must be 30.

vonovak commented 1 year ago

Hello and thanks for reporting, can you please include a video of the issue? It's not quite clear what the repro steps are. Thank you 🙂

k-henning commented 1 year ago

Yes here are the steps to reproduce along with a video. This test was done using the example project included in this repo.

  1. Open up example app on an Android device.
  2. Set the mode prop to time.
  3. Set the display prop to spinner.
  4. Set the minute interval prop to 30.
  5. Open the time picker by selecting "show picker".
  6. Slide the minute spinner from 00 to 30.
  7. Notice how the hour spinner is changing.

Video: https://github.com/react-native-datetimepicker/datetimepicker/assets/123596671/c92eaa1c-c0eb-46c7-874d-90b270a38e0c

@vonovak is there any more info that I need to provide?

Pradetto commented 4 months ago

FWIW, I ran into this issue as well on Android the only solution I found thus far was to set it to a different interval than 30 i.e. 15 minute intervals