0

I am using this

<input type="date" value={defaultValue || "MM/DD/YYYY"} onChange={this.handleChange} />

How i can disable future dates (for birth-date) ?

NOTE:

I ended up solving this ,

var today = new Date().toISOString().split('T')[0];
<input type="date"  onChange={this.handleChange} max={today} />

works well

Curious_guy
  • 161
  • 11
  • 1
    Does this answer your question? [Disable certain dates from html5 datepicker](https://stackoverflow.com/questions/17182544/disable-certain-dates-from-html5-datepicker) – Ashley H. Aug 24 '22 at 16:24
  • Awesome . it did. Thank you . I ended up using this var today = new Date().toISOString().split('T')[0]; – Curious_guy Aug 24 '22 at 16:37

0 Answers0