-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Ability to add minute step greater than 60 #313
base: gh-pages
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,7 +147,20 @@ | |
if (step) { | ||
newVal = this.minute - step; | ||
} else { | ||
newVal = this.minute - this.minuteStep; | ||
var minuteStep = this.minuteStep; | ||
if (this.minuteStep > 60) { | ||
var hourStep = Math.floor(this.minuteStep / 60); | ||
minuteStep -= (hourStep * 60); | ||
if (minuteStep == 0) { | ||
minuteStep = 60; | ||
} | ||
|
||
for (var i = 0; i<hourStep-(minuteStep == 60 ? 1 : 0); i++) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use If you're worried about verbosity on this line, you can pull out |
||
this.decrementHour(); | ||
} | ||
} | ||
|
||
newVal = this.minute - minuteStep; | ||
} | ||
|
||
if (newVal < 0) { | ||
|
@@ -559,7 +572,20 @@ | |
if (step) { | ||
newVal = this.minute + step; | ||
} else { | ||
newVal = this.minute + this.minuteStep - (this.minute % this.minuteStep); | ||
var minuteStep = this.minuteStep; | ||
if (this.minuteStep > 60) { | ||
var hourStep = Math.floor(this.minuteStep / 60); | ||
minuteStep -= (hourStep * 60); | ||
if (minuteStep == 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
minuteStep = 60; | ||
} | ||
|
||
for (var i = 0; i<hourStep-(minuteStep == 60 ? 1 : 0); i++) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
this.incrementHour(); | ||
} | ||
} | ||
|
||
newVal = this.minute + minuteStep - (this.minute % minuteStep); | ||
} | ||
|
||
if (newVal > 59) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
===
please; this fails lint checks