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

Convert to the next unit when the date pattern value is bigger than 1M #274

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

azzmiks
Copy link
Collaborator

@azzmiks azzmiks commented Jan 10, 2025

Subject: Merge #273 PR into master

Problem: DD backend accepts DatePattern values up to 10M, but DD UI does not render properly when the value of the DatePattern is high than 20 bits (~1M).

For example, a DatePattern value of 15.days gets converted by this library into the smaller unit (ms-> s-> m-> h-> d) whose value will be < 10M, which, in this particular case will be 1296000s will be accepted by the backend but it will cause DD UI to not show neither the steps nor the variables.

Solution: This PR changes the behavior to jump to the next unit if the value is >= 1M instead of > 10M. Also adds unit tests for this behavior.

@azzmiks azzmiks requested a review from a team as a code owner January 10, 2025 14:43
mahmedk91
mahmedk91 previously approved these changes Jan 10, 2025
@azzmiks azzmiks force-pushed the fix/date-variable-units branch 2 times, most recently from 9a90dde to 25db055 Compare January 10, 2025 17:29
@azzmiks azzmiks changed the title Convert to the next unit when the date pattern value is bigger than 1… Convert to the next unit when the date pattern value is bigger than or equal to 1M Jan 10, 2025
@azzmiks azzmiks changed the title Convert to the next unit when the date pattern value is bigger than or equal to 1M Convert to the next unit when the date pattern value is bigger than 1M Jan 10, 2025
@azzmiks azzmiks force-pushed the fix/date-variable-units branch 2 times, most recently from aaf5c40 to 4a09cf6 Compare January 12, 2025 22:03
@azzmiks azzmiks force-pushed the fix/date-variable-units branch from 4a09cf6 to 76d60e7 Compare January 12, 2025 22:27
@azzmiks azzmiks merged commit 31be753 into master Jan 13, 2025
3 checks passed
@azzmiks azzmiks deleted the fix/date-variable-units branch January 13, 2025 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants