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