mirror of
https://github.com/dataease/dataease.git
synced 2026-05-18 17:58:11 +08:00
fix: 动态时间组件
This commit is contained in:
@@ -114,10 +114,8 @@ class TimeDateServiceImpl extends WidgetService {
|
||||
const tarYear = nowYear
|
||||
if (dynamicSuffix === 'before') {
|
||||
const deffMonth = nowMonth - dynamicPrefix
|
||||
let diffYear = deffMonth / 12
|
||||
if (deffMonth < 0) {
|
||||
diffYear -= 1
|
||||
}
|
||||
const diffYear = Math.floor(deffMonth / 12)
|
||||
|
||||
return new Date(tarYear + diffYear, nowMonth - dynamicPrefix % 12, nowDate).getTime()
|
||||
} else {
|
||||
const deffMonth = nowMonth + dynamicPrefix
|
||||
|
||||
Reference in New Issue
Block a user