|
|
@ -42,6 +42,8 @@ function TimeStep(start, end, minimumStep, hiddenDates) { |
|
|
|
|
|
|
|
// hidden Dates options
|
|
|
|
this.switchedDay = false; |
|
|
|
this.switchedMonth = false; |
|
|
|
this.switchedYear = false; |
|
|
|
this.hiddenDates = hiddenDates; |
|
|
|
if (hiddenDates === undefined) { |
|
|
|
this.hiddenDates = []; |
|
|
@ -404,7 +406,31 @@ TimeStep.prototype.snap = function(date) { |
|
|
|
* @return {boolean} true if current date is major, else false. |
|
|
|
*/ |
|
|
|
TimeStep.prototype.isMajor = function() { |
|
|
|
if (this.switchedDay == true) { |
|
|
|
if (this.switchedYear == true) { |
|
|
|
this.switchedYear = false; |
|
|
|
switch (this.scale) { |
|
|
|
case TimeStep.SCALE.YEAR: |
|
|
|
case TimeStep.SCALE.MONTH: |
|
|
|
case TimeStep.SCALE.WEEKDAY: |
|
|
|
case TimeStep.SCALE.DAY: |
|
|
|
return true; |
|
|
|
default: |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
else if (this.switchedMonth == true) { |
|
|
|
this.switchedMonth = false; |
|
|
|
switch (this.scale) { |
|
|
|
case TimeStep.SCALE.YEAR: |
|
|
|
case TimeStep.SCALE.MONTH: |
|
|
|
case TimeStep.SCALE.WEEKDAY: |
|
|
|
case TimeStep.SCALE.DAY: |
|
|
|
return true; |
|
|
|
default: |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
else if (this.switchedDay == true) { |
|
|
|
this.switchedDay = false; |
|
|
|
switch (this.scale) { |
|
|
|
case TimeStep.SCALE.MILLISECOND: |
|
|
@ -417,6 +443,7 @@ TimeStep.prototype.isMajor = function() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
switch (this.scale) { |
|
|
|
case TimeStep.SCALE.MILLISECOND: |
|
|
|
return (this.current.getMilliseconds() == 0); |
|
|
|