I have this:
<DatePicker
selected={this.state.startDate}
onChange={this.handleChange}
showTimeSelect
minDate={new Date()}
minTime={setHours(setMinutes(new Date(), 0), 7)}
maxTime={setHours(setMinutes(new Date(), 0), 17)}
filterDate={this.isWeekday}
timeFormat="HH:mm"
timeIntervals={30}
dateFormat="d MMMM, yyyy h:mm aa"
timeCaption="Hora"
locale="es"
/>
But setHours and setMinutes throw an error. I am missing something?
Also, with filterDate I want to allow only to select a weekday. Does anyone have the function for isWeekday?
Hi, you need date-fns module for that, take a look at this example.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@no1lov3sme The URL which you shared it's throwing 404.
@no1lov3sme The URL which you shared it's throwing 404.
import setSeconds from "date-fns/setSeconds";
import setMinutes from "date-fns/setMinutes";
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
Source