Repository navigation
Is it possible to have different times in selectsRange #6084
Unanswered
MaltheGram
asked this question in
Q&A
Replies: 1 comment
|
In the current 9.1.0 release, const [[startDate, endDate], setRange] = useState([
new Date(2026, 10, 3, 9),
new Date(2026, 10, 3, 17),
]);
<DatePicker
selected={startDate}
startDate={startDate}
endDate={endDate}
onChange={setRange}
selectsRange
showTimeInput
allowSameDay
dateFormat="yyyy-MM-dd HH:mm"
shouldCloseOnSelect={false}
/>Choose both dates, then edit Time (Start) and Time (End) independently. Complete runnable form and checks cover different same-day times, an overnight range, repeated date selection, clearing and actual submission at desktop/mobile widths. The form also validates that the end is after the start; it uses local dates/times and does not choose a time-zone policy for your application. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Would it be possible to select a different time on start date and end date? Using the
showTimeSelectprop it sets the same time both start and end date.All reactions