Skip to content
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

The values of the time picker on android are jumping #886

Open
endyinthesun opened this issue Jan 16, 2025 · 0 comments
Open

The values of the time picker on android are jumping #886

endyinthesun opened this issue Jan 16, 2025 · 0 comments

Comments

@endyinthesun
Copy link

Describe the bug
Hi! I have a problem with android time picker.
I use an inline time picker and a 12-hour format.
When I set minimumDate and maximumDate between noon and try to change the "AM/PM" value, I get inappropriate behavior.
The values of the time picker start jumping.

Expected behavior
When I press “AM/PM” and the current value is outside the “minimumDate” and “maximumDate”, the minimum or maximum allowable value should be selected.

export default function App {
    const [time, setTime] = useState<Date>(new Date());

const minDate = new Date('2025-01-16T09:00:00.000Z');
    const maxDate = new Date('2025-01-16T14:00:00.000Z');

return
    <View style={styles.container}>
          <DatePicker
            locale='en'
            date={time}
            onDateChange={setTime}
            mode='time'
            theme='light'
            minimumDate={minDate}
            maximumDate={maxDate}
            timeZoneOffsetInMinutes={0}
          />
        </View>

}

Smartphone (please complete the following information):

  • OS: Android
  • React Native version 0.74.5
  • react-native-date-picker version 5.0.4(also tried 5.0.8)
Selected.January.16.2025.15.56.41.mp4
@endyinthesun endyinthesun changed the title The values of the time picker on android is jumping The values of the time picker on android are jumping Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant