Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DateTimeRangePicker] Fix selection on same day #12604

Merged
merged 2 commits into from Mar 29, 2024

Conversation

LukasTy
Copy link
Member

@LukasTy LukasTy commented Mar 29, 2024

Fixes #12586

The problem was that we were using isBefore to compare the dates when calculating the new range.
This works for DateRangePicker, but in the case of DateTimeRangePicker its a problem, because it includes time in comparison.
Changed the comparison function to isBeforeDay instead.

@LukasTy LukasTy added bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! component: DateTimeRangePicker The React component labels Mar 29, 2024
@LukasTy LukasTy self-assigned this Mar 29, 2024
@mui-bot
Copy link

mui-bot commented Mar 29, 2024

Deploy preview: https://deploy-preview-12604--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 7f8e8c3

Copy link
Member

@flaviendelangle flaviendelangle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix makes a lot of sense

@LukasTy LukasTy merged commit fdaafd1 into mui:master Mar 29, 2024
20 checks passed
@LukasTy LukasTy deleted the fix-dtr-same-day-selection branch March 29, 2024 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: DateTimeRangePicker The React component component: pickers This is the name of the generic UI component, not the React module!
Projects
None yet
3 participants