CN-1720 fix: 修复个别时区偏移量不是整数小时时时区计算出错的问题

This commit is contained in:
chenjinsong
2024-11-13 13:49:40 +08:00
parent 2061fc4bf5
commit 652f41a905

View File

@@ -106,7 +106,9 @@ export function timestampToList (time) {
* @returns {number}
*/
export function millTimestampDiffFromTz () {
return parseInt(localStorage.getItem(storageKey.timezoneLocalOffset)) * 3600 * 1000 - window.$dayJs.tz().utcOffset() * 60 * 1000
const localOffset = Number(localStorage.getItem(storageKey.timezoneLocalOffset)) * 3600 * 1000
const serverOffset = window.$dayJs.tz().utcOffset() * 60 * 1000
return localOffset - serverOffset
}
/**
* echarts时间类型横坐标formatter