We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 603e0cd commit 538464fCopy full SHA for 538464f
packages/datetime2/src/components/date-range-picker3/dateRangePicker3.tsx
@@ -277,6 +277,10 @@ export class DateRangePicker3 extends DateFnsLocalizedComponent<DateRangePicker3
277
this.setState({ value: newDateRange, time: newTimeRange });
278
};
279
280
+ // When a user sets the time value before choosing a date, we need to pick a date for
281
+ // them to have something to store the time on.
282
+ // The default depends on the value of the other date since there's an invariant
283
+ // that the left/0 date is always less than the right/1 date.
284
private getDefaultDate = (dateIndex: number) => {
285
const { value } = this.state;
286
const otherIndex = dateIndex === 0 ? 1 : 0;
0 commit comments