Skip to content

fix: Correct hours-to-days conversion and improve Event Limits UX#27956

Closed
AritraDey-Dev wants to merge 2 commits intocalcom:mainfrom
AritraDey-Dev:pr/aritra
Closed

fix: Correct hours-to-days conversion and improve Event Limits UX#27956
AritraDey-Dev wants to merge 2 commits intocalcom:mainfrom
AritraDey-Dev:pr/aritra

Conversation

@AritraDey-Dev
Copy link
Contributor

@AritraDey-Dev AritraDey-Dev commented Feb 14, 2026

What does this PR do?

  • This PR fixes a math logic error in convertToNewDurationType.ts and enhances the "Minimum Booking Notice" UI.

Fix : Corrected the hours_days conversion 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
  • Add side-by-side screenshots of the original and updated change.
  • Highlight any significant change(s).

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

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).

Signed-off-by: Aritra Dey <adey01027@gmail.com>
Signed-off-by: Aritra Dey <adey01027@gmail.com>
@CLAassistant
Copy link

CLAassistant commented Feb 14, 2026

CLA assistant check
All committers have signed the CLA.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Feb 14, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Copy link
Member

@romitg2 romitg2 left a comment

Choose a reason for hiding this comment

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

@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 romitg2 closed this Feb 15, 2026
@AritraDey-Dev
Copy link
Contributor Author

@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 convertToNewDurationType.ts where the hours-to-days conversion incorrectly multiplies instead of dividing (causing 24 hours to equal 576 days) as i mentioned in the pr description too.
so if that makes sense to fix that logic,i can only keep that fix in this PR,wdyt?

@romitg2
Copy link
Member

romitg2 commented Feb 15, 2026

@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 convertToNewDurationType.ts where the hours-to-days conversion incorrectly multiplies instead of dividing (causing 24 hours to equal 576 days) as i mentioned in the pr description too. so if that makes sense to fix that logic,i can only keep that fix in this PR,wdyt?

@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!

@AritraDey-Dev
Copy link
Contributor Author

created here #27964

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Created by Linear-GitHub Sync size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants