feature/date-reverse-ordered-range#8130
Conversation
|
Thanks for your interest in palantir/blueprint, @deb2000-sudo! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request. |
Generate changelog in
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the DateRangePicker time-change behavior to automatically normalize (swap) the selected range when the start date-time becomes later than the end date-time.
Changes:
- Added logic in
handleTimeChangeto swapnewDateRangeentries when they become reverse-ordered. - Kept
newTimeRangein sync by swapping the corresponding time entries when the date range is swapped.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const temp = newDateRange[0]; | ||
| newDateRange[0] = newDateRange[1]; | ||
| newDateRange[1] = temp; | ||
|
|
||
| const tempTime = newTimeRange[0]; | ||
| newTimeRange[0] = newTimeRange[1]; | ||
| newTimeRange[1] = tempTime; | ||
| } |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Fixes #8122
Checklist
Changes proposed in this pull request:
Here I have changed in dateRangePicker.tsx there is a function called handleTimeChange I have modified the code on that
Reviewers should focus on:
private handleTimeChange = (newTime: Date, dateIndex: number) => {
this.props.timePickerProps?.onChange?.(newTime);
Screenshot
closes #8122