我不知道为什么,但是当我尝试打电话时
this.$refs.timeline.on('rangechange', function (start, end, byUser, event) {
console.log('timechanged...')
})
我每次都收到这个错误Error: Invalid start "NaN"。
我在谷歌上搜索了解决方案,但我一无所获。
以下是时间线的选项:
timeline: {
stack: true,
start: new Date(),
end: new Date(1000 * 60 * 60 * 24 + (new Date()).valueOf()),
min: new Date(2018, 0, 1),
max: new Date(2019, 0, 1),
zoomMin: 1000 * 27 * 24 * 24, // if you want to zoom more in then lower the 27
zoomMax: 1000 * 60 * 60 * 24 * 31 * 3,
orientation: 'top'
}
我已经登录vis.js脚本发生了什么。它开始记录开始和结束日期,然后它只是抛出error NaN.
这是vis.js我收到错误的脚本代码。
console.log('START', start)
console.log('END', end)
var newStart = start != null ? util.convert(start, 'Date').valueOf() : this.start,
newEnd = end != null ? util.convert(end, 'Date').valueOf() : this.end,
max = this.options.max != null ? util.convert(this.options.max, 'Date').valueOf() : null,
min = this.options.min != null ? util.convert(this.options.min, 'Date').valueOf() : null,
diff;
// check for valid number
if (isNaN(newStart) || newStart === null) {
throw new Error('Invalid start "' + start + '"');
}
if (isNaN(newEnd) || newEnd === null) {
throw new Error('Invalid end "' + end + '"');
}
有谁知道如何解决这个问题?谢谢。
