|
@ -39,7 +39,8 @@ function TimeAxis (body, options) { |
|
|
orientation: 'bottom', // supported: 'top', 'bottom'
|
|
|
orientation: 'bottom', // supported: 'top', 'bottom'
|
|
|
// TODO: implement timeaxis orientations 'left' and 'right'
|
|
|
// TODO: implement timeaxis orientations 'left' and 'right'
|
|
|
showMinorLabels: true, |
|
|
showMinorLabels: true, |
|
|
showMajorLabels: true |
|
|
|
|
|
|
|
|
showMajorLabels: true, |
|
|
|
|
|
format: null |
|
|
}; |
|
|
}; |
|
|
this.options = util.extend({}, this.defaultOptions); |
|
|
this.options = util.extend({}, this.defaultOptions); |
|
|
|
|
|
|
|
@ -64,7 +65,7 @@ TimeAxis.prototype = new Component(); |
|
|
TimeAxis.prototype.setOptions = function(options) { |
|
|
TimeAxis.prototype.setOptions = function(options) { |
|
|
if (options) { |
|
|
if (options) { |
|
|
// copy all options that we know
|
|
|
// copy all options that we know
|
|
|
util.selectiveExtend(['orientation', 'showMinorLabels', 'showMajorLabels','hiddenDates'], this.options, options); |
|
|
|
|
|
|
|
|
util.selectiveExtend(['orientation', 'showMinorLabels', 'showMajorLabels','hiddenDates', 'format'], this.options, options); |
|
|
|
|
|
|
|
|
// apply locale to moment.js
|
|
|
// apply locale to moment.js
|
|
|
// TODO: not so nice, this is applied globally to moment.js
|
|
|
// TODO: not so nice, this is applied globally to moment.js
|
|
@ -181,8 +182,10 @@ TimeAxis.prototype._repaintLabels = function () { |
|
|
var minimumStep = timeLabelsize - DateUtil.getHiddenDurationBefore(this.body.hiddenDates, this.body.range, timeLabelsize); |
|
|
var minimumStep = timeLabelsize - DateUtil.getHiddenDurationBefore(this.body.hiddenDates, this.body.range, timeLabelsize); |
|
|
minimumStep -= this.body.util.toTime(0).valueOf(); |
|
|
minimumStep -= this.body.util.toTime(0).valueOf(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var step = new TimeStep(new Date(start), new Date(end), minimumStep, this.body.hiddenDates); |
|
|
var step = new TimeStep(new Date(start), new Date(end), minimumStep, this.body.hiddenDates); |
|
|
|
|
|
if (this.options.format) { |
|
|
|
|
|
step.setFormat(this.options.format); |
|
|
|
|
|
} |
|
|
this.step = step; |
|
|
this.step = step; |
|
|
|
|
|
|
|
|
// Move all DOM elements to a "redundant" list, where they
|
|
|
// Move all DOM elements to a "redundant" list, where they
|
|
|