fix: utc时间轴不正确问题
This commit is contained in:
parent
f6a7547aff
commit
b290785eb4
|
@ -80,8 +80,8 @@ const initialOption = {
|
|||
// `
|
||||
return `
|
||||
<div>${params.marker}${params.name}</div>
|
||||
<div>START:${dayjs.utc(params.value[4]).format('YYYY-MM-DD HH:mm:ss')}</div>
|
||||
<div style="white-space: pre"> END:${dayjs.utc(params.value[2]).format('YYYY-MM-DD HH:mm:ss')}</div>
|
||||
<div>START:${dayjs(params.value[4]).format('YYYY-MM-DD HH:mm:ss')}</div>
|
||||
<div style="white-space: pre"> END:${dayjs(params.value[2]).format('YYYY-MM-DD HH:mm:ss')}</div>
|
||||
`
|
||||
},
|
||||
},
|
||||
|
@ -190,7 +190,7 @@ export default {
|
|||
let now = dayjs(new Date())
|
||||
now = now.add(1, 'hour').set('minute', 0).set('second', 0).set('millisecond', 0)
|
||||
|
||||
const max = now.valueOf()
|
||||
const max = dayjs(dayjs.utc(now.valueOf()).format('YYYY-MM-DD HH:mm:ss')).valueOf()
|
||||
const min = max - this.scaleSettings.cacheTime * 24 * 60 * 60 * 1000
|
||||
const option = cloneDeep(initialOption)
|
||||
const { grid, xAxis, yAxis, series, dataZoom } = option
|
||||
|
@ -212,7 +212,7 @@ export default {
|
|||
formatter: (val) => {
|
||||
// let dateTime = new Date(val)
|
||||
// return dayjs.utc(dateTime).format('HH:mm\nMM/DD')
|
||||
return dayjs.utc(val).format('HH:mm\nMM/DD')
|
||||
return dayjs(val).format('HH:mm\nMM/DD')
|
||||
},
|
||||
color: '#ade6ee',
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user