fix: Correct hours-to-days conversion and improve Event Limits UX#27956
fix: Correct hours-to-days conversion and improve Event Limits UX#27956AritraDey-Dev wants to merge 2 commits intocalcom:mainfrom
Conversation
Signed-off-by: Aritra Dey <adey01027@gmail.com>
Signed-off-by: Aritra Dey <adey01027@gmail.com>
There was a problem hiding this comment.
@AritraDey-Dev Thank you for your work! but this UX change is not really required.
also from next time please open issue and wait until it gets approval before you start working on it to avoid unnecessary effort.
|
@romitg2 thanks for the feedback! since the UI change isn't needed,i can remove it from this patch. However, there is a genuine logic bug in |
@AritraDey-Dev If that's the case then it would be great to fix it! could you please create new PR and Issue for that? Thank you! |
|
created here #27964 |
What does this PR do?
convertToNewDurationType.tsand enhances the "Minimum Booking Notice" UI.Fix : Corrected the
hours_daysconversion which was incorrectly multiplying by 24 (e.g., 24 hours converted to 576 days).UX Improvement: Enabled automatic value conversion in the UI. Previously, changing the dropdown (e.g., Hours to Days) would not change the value at all. It now correctly recalculates the number (e.g., 24 Hours → 1 Day).
test: Added unit tests for the time conversion logic.
Visual Demo (For contributors especially)
A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).
Video Demo (if applicable):
Before:
Screencast.from.2026-02-15.02-50-34.webm
After:
Screencast.from.2026-02-14.23-27-22.webm
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
To test, run yarn dev, navigate to an event's Limits tab, and switch the Minimum Booking Notice units to verify that the value now automatically recalculates (e.g., 24 Hours → 1 Day).