Skip to content

Commit

Permalink
fix: date picker start time can later than end time (#555)
Browse files Browse the repository at this point in the history
  • Loading branch information
yangxiaolang authored Jun 11, 2024
1 parent b360973 commit 3636301
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/date-picker/calendar/range-picker-panel/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,10 @@ export class DateRangePickerPanelComponent extends CommonFormControl<Dayjs[]> {
}

confirmValue(value: Dayjs[], closeThen = true) {
this.emitValue(value);
const sortValue = value.sort((startDate, endDate) =>
startDate.isAfter(endDate) ? 1 : -1,
);
this.emitValue(sortValue);
closeThen && this.confirm.next();
}

Expand Down

0 comments on commit 3636301

Please sign in to comment.