mmazzarolo / react-native-modal-datetime-picker

A React-Native datetime-picker for Android and iOS
MIT License
2.98k stars 399 forks source link

MinuteInterval time return current time in ios , android working fine #734

Open ajay-mandaviya opened 9 months ago

ajay-mandaviya commented 9 months ago

Environment

Platforms

IOS

Versions

Description

This minuteInterval props working fine on android and always return user selection time and minute from picker but on ios always return the current time not selected time from the picker when time selected minute is in current time.
Open picker in ios let's say current time is 10:45AM and from picker user select the time 10:30AM so time picker always return the current time. same for if time is 10:10PM and user select time is 10:00 PM it always return current time 10:10 PM. Current time 10:55, Open DateTimePickerModal select time 10:30 Minute return time 10:55 which is current time.

Reproducible Demo

   <DateTimePickerModal
        isVisible={stateBooleanValue}
        mode="time"
        minuteInterval={30}
        display="spinner"
        key={'endTime'}
        negativeButton={{ label: 'Cancel' }}
        positiveButton={{ label: 'Set Endtime' }}
        confirmTextIOS={'Set EndTime time'}
        onConfirm={endTimeConfirm}
        onCancel={hideDatePickers}
        onError={(error: any) => {
          console.log('date error', error)
        }}
      />