Convert to the next unit when the date pattern value is bigger than 1M #274
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.