I'm creating date range picker with react material ui. My logic behind this functionality is to select required date and if required date has been selected, disable all past dates from selected dates. How to implement this react material ui?
Here is my code,
import React from 'react';
import {render} from 'react-dom';
import DatePicker from 'material-ui/DatePicker';
function disablePrevDates(date) {
return date.getDay() === 0;
}
class App extends React.Component {
render() {
return (
<div>
<DatePicker hintText="Check-in" shouldDisableDate={disablePrevDates} />
</div>
)
}
}
export default App;
Here it is: