decrementMinute - added round to next step for when initial value is not a multiple of the step.#324
Open
smistir wants to merge 3 commits intojdewit:gh-pagesfrom
smistir:patch-1
Open
decrementMinute - added round to next step for when initial value is not a multiple of the step.#324smistir wants to merge 3 commits intojdewit:gh-pagesfrom smistir:patch-1
smistir wants to merge 3 commits intojdewit:gh-pagesfrom
smistir:patch-1
Conversation
Updated decrementMinute to behave similar to incrementMinute such that decrement will first round down if current value is not a multiple of this.minuteStep. **incrementMinute will apply the increment and then remove the remaining so that the new value is the next-step up (this.minute==2 with increment applied will result in "15" with a this.minuteStep==15). Previous implementation would not round decrement (this.minute==2 and this.minuteStep==15 will result in the minute becoming "47" instead of "0".
Added UnitTest test-cases to test when the initial value is not a Multiple of the step for incrementMinute and decrementMinute
fixed formatting issues within the file
Collaborator
|
@smistir thank you for this! Sorry for the wait. I'll be merging some PRs soon. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Updated bootstrap-timepicker.js to add functionality to round to the next step during decrement when the initial value is not a multiple of the step (similar to incrementMinute). During the call to decrementMinute, when the value is '02' and step is '15', the new value will become '00' and further decrements will following the step (02 -> 00 -> 45 -> 30).
incrementMinute follows this same behavior already (02 -> 15 -> 30 -> 45).
Added UnitTest test cases to test this scenario (for both incrementMinute and decrementMinute).