Calendar: When stepMinute is set, the time value does not "snap" on initial date change #5027
Labels
Type: Bug
Issue contains a defect related to a specific component.
Milestone
Describe the bug
Using the Calendar component and setting the
stepMinute
prop (together withshowTime
) does not behave as expected when setting the initial value. If the initial value isnull|undefined
and the date on the Calendar picker is selected (without "touching" the time controls) - the time on the actual date value is not snapped to the next n-th minute but it's rather always the current time.The date picker's time controls are correctly "snapped" to the next n-th minute though.
This also leads to a weird behavior: the up or down buttons on the time picker UI must be clicked twice to change the time.
Reproducer
https://stackblitz.com/edit/react-8t4ps2-xsg1cm
PrimeReact version
10.0.2
React version
18.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
Calendar
component on the page;showTime
prop totrue
;stepMinute
prop to some value (like15
);stepMinute
prop is set to15
so the expectation is for the time to "snap" to the next 15th minute.Expected behavior
Time should "snap" to the next n-th minute which is set via
stepMinute
prop at the very moment the date is selected.The text was updated successfully, but these errors were encountered: