Next.js Discord

Discord Forum

date and time 24 hour format

Unanswered
Sun bear posted this in #help-forum
Open in Discord
Original message was deleted.

4 Replies

Hi, you can use the reactdatepicker library to do so for the time gap you need.

To not allow the user select the previous date you can simply pass a new Date() to the minDate prop of the DatePicker component like this:

<DatePicker
  selected={this.state.startDate}
  onChange={this.handleChange}
  minDate={new Date()}
/>


🔗 https://reactdatepicker.com/#example-inject-specific-times
Sun bear
thank you so much
No worries
If you don't mind, please mark the question as answered