react-native-date-picker icon indicating copy to clipboard operation
react-native-date-picker copied to clipboard

Minimum date not setting correctly

Open monicse09ku opened this issue 3 years ago • 2 comments

Describe the bug The minimum date is set to be current time but it is showing 1 hour earlier at mid night. But after one hour it got fixed automatically.

Expected behavior Should show current time as minimum date time.

To Reproduce

export default class App extends Component {

  state = { date: new Date() }

  render = () =>
    <DatePicker
          androidVariant="nativeAndroid"
          date={this.state.auctionStartDate}
          mode={'datetime'}
          minimumDate={new Date()}
          onDateChange={(date) => this.setRegularAuctionStartDate(date)}
      /> 

}

Smartphone (please complete the following information):

  • OS: [Android]
  • React Native version [e.g. 0.63.3]
  • react-native-date-picker version [e.g. 3.2.10]

monicse09ku avatar Jun 27 '21 19:06 monicse09ku

Hi, I've tried but I don't manage to reproduce this, could you help me out be answering some questions?

  1. When you say midnight, do you mean the time between 12:00am (00:00) and 1.00am (01:00)?
  2. Are you using 24h or 12h mode when this problem occurs?
  3. What timezone are you in?
  4. What language is your phone set to?

henninghall avatar Aug 20 '21 08:08 henninghall

I am sorry, as it is been a while I cant remember everything, and also I am using another package now. But I am trying to provide you with as much data I can remember

  1. Yes
  2. Cant remember
  3. Asthana/Dhaka
  4. English

monicse09ku avatar Aug 20 '21 10:08 monicse09ku

Any update for this? Still does not work on android const minDate = new Date().setMinutes(new Date().getMinutes() + 30);

<DatePicker date={dateTime} onDateChange={setDateTime} androidVariant='iosClone' minimumDate={new Date(minDate)} maximumDate={new Date(maxDate)} minuteInterval={15} />

phanvanphuhn avatar Oct 10 '22 03:10 phanvanphuhn

Following code worked for me

<DatePicker
    androidVariant="nativeAndroid"
    date={this.state.auctionStartDate}
    mode={'datetime'}
    minimumDate={new Date()}
    onDateChange={(date) => this.setRegularAuctionStartDate(date)}
/>

monicse09ku avatar Oct 10 '22 06:10 monicse09ku

I have recently fixed a combined timezone min/max issue. If someone ends up here, please try latest version and let me know if it didn't solve it for you

henninghall avatar Apr 20 '23 05:04 henninghall