react-native-date-picker
react-native-date-picker copied to clipboard
Minimum date not setting correctly
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]
Hi, I've tried but I don't manage to reproduce this, could you help me out be answering some questions?
- When you say midnight, do you mean the time between 12:00am (00:00) and 1.00am (01:00)?
- Are you using 24h or 12h mode when this problem occurs?
- What timezone are you in?
- What language is your phone set to?
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
- Yes
- Cant remember
- Asthana/Dhaka
- English
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} />
Following code worked for me
<DatePicker
androidVariant="nativeAndroid"
date={this.state.auctionStartDate}
mode={'datetime'}
minimumDate={new Date()}
onDateChange={(date) => this.setRegularAuctionStartDate(date)}
/>
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