-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[pickers] Fix DigitalClock
time options on a DST
switch day
#10793
Conversation
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
@@ -124,6 +124,21 @@ export const mergeDateAndTime = <TDate>( | |||
return mergedDate; | |||
}; | |||
|
|||
export const isEqualTime = <TDate>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am afraid this is risky if we support ms one day.
Can the ms be different? If not we could check them as well
@LukasTy what is the current status of this PR? |
I shelved it while tackling more pressing matters. |
Deploy preview: https://deploy-preview-10793--material-ui-x.netlify.app/ |
DigitalClock
DST
related problemDigitalClock
time options on a DST
switch day
return ( | ||
<ClockItem | ||
key={formattedValue} | ||
key={`${option.valueOf()}-${formattedValue}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 That is weird indeed
We could also format with the day I guess, but it's probably not worth the computation time that is higher than .valueOf
+a formatted value that we are also using elsewhere.
I have updated the PR/solution and description with some extra notes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix make sense to me
Thanks for taking care of it 🙏
return ( | ||
<ClockItem | ||
key={formattedValue} | ||
key={`${option.valueOf()}-${formattedValue}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 That is weird indeed
We could also format with the day I guess, but it's probably not worth the computation time that is higher than .valueOf
+a formatted value that we are also using elsewhere.
Fixes #10783
ChangeDigitalClock
time options building to usestartOfYear
to avoidDST
issues.After some exploration, I decided to go with a solution proposed here: #10783 (comment).
In this way we are not fighting to not have duplicate time options as they technically make sense, we only ensure that options for the whole day are included (not limiting options to
24 hours
*minutesStep
)