|
|
@ -164,9 +164,9 @@ TimeStep.prototype.roundToMinor = function() { |
|
|
|
case 'minute': this.current.subtract(this.current.minutes() % this.step, 'minutes'); break; |
|
|
|
case 'hour': this.current.subtract(this.current.hours() % this.step, 'hours'); break; |
|
|
|
case 'weekday': // intentional fall through
|
|
|
|
case 'day': this.current.subtract((this.current.date() - 1) % this.step); break; |
|
|
|
case 'month': this.current.subtract(this.current.month() % this.step); break; |
|
|
|
case 'year': this.current.subtract(this.current.year() % this.step); break; |
|
|
|
case 'day': this.current.subtract((this.current.date() - 1) % this.step, 'day'); break; |
|
|
|
case 'month': this.current.subtract(this.current.month() % this.step, 'month'); break; |
|
|
|
case 'year': this.current.subtract(this.current.year() % this.step, 'year'); break; |
|
|
|
default: break; |
|
|
|
} |
|
|
|
} |
|
|
@ -197,7 +197,7 @@ TimeStep.prototype.next = function() { |
|
|
|
this.current.add(this.step, 'hour'); |
|
|
|
// in case of skipping an hour for daylight savings, adjust the hour again (else you get: 0h 5h 9h ... instead of 0h 4h 8h ...)
|
|
|
|
// TODO: is this still needed now we use the function of moment.js?
|
|
|
|
this.current.subtract(this.current.hours() % this.step); |
|
|
|
this.current.subtract(this.current.hours() % this.step, 'hour'); |
|
|
|
break; |
|
|
|
case 'weekday': // intentional fall through
|
|
|
|
case 'day': this.current.add(this.step, 'day'); break; |
|
|
|