Minute Decrements Inconsistent with Increments
When the user increments the minute value, it will jump to the nearest multiple of the minuteStep, but not for decrements. I'm not sure this is correct behavior, but if it isn't, here's a suggested fix (although it's not as elegant as the increment code):
var newVal;
if((this.minute - this.minuteStep) % this.minuteStep != 0) {
if(this.minute - this.minuteStep < 0) {
newVal = 0;
} else {
newVal = this.minute - ((this.minute - this.minuteStep) % this.minuteStep);
}
} else {
newVal = this.minute - this.minuteStep;
}
Is there a fix for this issue? Here's my scenario:
- minute value = 12 with minuteStep = 5
- Clicked on arrow down. This will give me 07, then 02 after clicking it again.
- Clicked on arrow up. This will give me 10, then after clicking it again will give me 15.
Why did it changed to the nearest multiple after clicking arrow up instead of
current value + minuteStep
When the user increments the minute value, it will jump to the nearest multiple of the minuteStep, but not for decrements. I'm not sure this is correct behavior, but if it isn't, here's a suggested fix (although it's not as elegant as the increment code):
var newVal; if((this.minute - this.minuteStep) % this.minuteStep != 0) { if(this.minute - this.minuteStep < 0) { newVal = 0; } else { newVal = this.minute - ((this.minute - this.minuteStep) % this.minuteStep); } } else { newVal = this.minute - this.minuteStep; }
I'm using this timepicker for a Yii2 project where do i do the suggested changes..?