question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

maxDate and minDate not working properly

See original GitHub issue

On Android platform after setting maxDate/minDate, disabled dates are rendered in the lighter color but it is still possible to set them. They are not disabled as expected. Same code works well on iOS platform.

const today = new Date(2016, 2, 15);
<DatePicker
 style={styles.datePicker}
  date={this.state.date}
  mode="date"
  placeholder="select date"
  format="DD-MM-YYYY"
  maxDate={today}
  confirmBtnText="Confirm"
  cancelBtnText="Cancel"
  customStyles={{
    dateIcon: {
      position: 'absolute',
      left: 0,
      top: 4,
      marginLeft: 0,
    },
    dateInput: {
      marginLeft: 36,
    },
  }}
 onDateChange={(date) => this.setState({date})}
/>

image

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:10
  • Comments:14

github_iconTop GitHub Comments

4reactions
DevAeliuscommented, Jul 18, 2019

for set minDate = today <DatePicker minimumDate={new Date()} onDateChange={(_sd) => this.setState({ _sd })} value={this.state._sd} />

4reactions
igor-shyrnincommented, Mar 15, 2018

Format of DatePicker should be same as format of minDate and maxDate. It solved issue for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jquery datepicker range (mindate maxdate) is not working
When min and max date are expressions they should be as strings and properly defined. Here is link for jquery ui datepicker MaxDate...
Read more >
datePicker and minDate/maxDate/defaultDate/dateFormat not ...
I'm working on a template for WordPress that is utilizing jQuery UI's datePicker to display a calendar on the page. I'm having some...
Read more >
MinDate / MaxDate not working properly in UI for ASP.NET AJAX
Problem #1​​ I can show it properly in the time view picker. However, when I set the MinDate and the MaxDate I am...
Read more >
Datepicker Widget - jQuery UI API Documentation
maxDate. minDate. monthNames. monthNamesShort. navigationAsDateFormat ... You can customize the date format and language, restrict the selectable date ...
Read more >
Minimum and Maximum Constraints for Date and Time Pickers
The Problem. React-datepicker component provides two properties to constraint the selection of dates: minDate and maxDate.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found