@ -28,7 +28,7 @@ var util = require('../util');
* @ param { Date } [ end ] The end date
* @ param { Date } [ end ] The end date
* @ param { Number } [ minimumStep ] Optional . Minimum step size in milliseconds
* @ param { Number } [ minimumStep ] Optional . Minimum step size in milliseconds
* /
* /
function TimeStep ( start , end , minimumStep , hiddenDates ) {
function TimeStep ( start , end , minimumStep , hiddenDates , options ) {
this . moment = moment ;
this . moment = moment ;
// variables
// variables
@ -58,6 +58,8 @@ function TimeStep(start, end, minimumStep, hiddenDates) {
}
}
this . format = TimeStep . FORMAT ; // default formatting
this . format = TimeStep . FORMAT ; // default formatting
this . options = options ? options : { } ;
}
}
// Time formatting
// Time formatting
@ -222,6 +224,8 @@ TimeStep.prototype.next = function() {
if ( this . current . weekday ( ) !== 0 ) { // we had a month break not correlating with a week's start before
if ( this . current . weekday ( ) !== 0 ) { // we had a month break not correlating with a week's start before
this . current . weekday ( 0 ) ; // switch back to week cycles
this . current . weekday ( 0 ) ; // switch back to week cycles
this . current . add ( this . step , 'week' ) ;
this . current . add ( this . step , 'week' ) ;
} else if ( this . options . showMajorLabels === false ) {
this . current . add ( this . step , 'week' ) ; // the default case
} else { // first day of the week
} else { // first day of the week
var nextWeek = this . current . clone ( ) ;
var nextWeek = this . current . clone ( ) ;
nextWeek . add ( 1 , 'week' ) ;
nextWeek . add ( 1 , 'week' ) ;