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

How to set max date #233

Closed
rafioktavian opened this issue Mar 27, 2021 · 1 comment
Closed

How to set max date #233

rafioktavian opened this issue Mar 27, 2021 · 1 comment

Comments

@rafioktavian
Copy link

I have code

 const maxDateValue = new Date().toISOString();
<DateRangePicker
  maxDate={maxDateValue}
  autoUpdateInput={true}
  startDate={startDate}
  endDate={endDate}
  locale={{ format: "YYYY-MM-DD" }} 
  onApply={onChangeDate}>
  <input type="text" className="form-control" value={labelDate} onChange={onChangeDate} />
</DateRangePicker>

how the solution to this problem?

@skratchdot
Copy link
Owner

You need to change your code to use the initialSettings prop. You also need to use this component as an "uncontrolled" component:
https://github.com/skratchdot/react-bootstrap-daterangepicker/#documentation

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

2 participants