diff --git a/common/changes/@visactor/vtable/3348-bug-vtable-gantt-updateScale_2025-01-26-09-55.json b/common/changes/@visactor/vtable/3348-bug-vtable-gantt-updateScale_2025-01-26-09-55.json new file mode 100644 index 000000000..0a9d1f7ee --- /dev/null +++ b/common/changes/@visactor/vtable/3348-bug-vtable-gantt-updateScale_2025-01-26-09-55.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: updateScales to quarter taskbar size error #3348\n\n", + "type": "none", + "packageName": "@visactor/vtable" + } + ], + "packageName": "@visactor/vtable", + "email": "892739385@qq.com" +} \ No newline at end of file diff --git a/packages/vtable-gantt/src/tools/util.ts b/packages/vtable-gantt/src/tools/util.ts index c517ebdb2..67955bb1e 100644 --- a/packages/vtable-gantt/src/tools/util.ts +++ b/packages/vtable-gantt/src/tools/util.ts @@ -1,4 +1,5 @@ import { isValid } from '@visactor/vutils'; +import { DayTimes } from '../gantt-helper'; /** * throttle 保障了首次立即执行 后续触发的回调执行间隔delay时间 区别于throttle2 最后执行时机会提前 @@ -706,7 +707,8 @@ export function computeCountToTimeScale( Math.floor(adjusted_date.getMonth() / 3) - Math.floor(startDate.getMonth() / 3); difference += - (adjusted_date.getDate() - startDate.getDate()) / + (adjusted_date.getTime() - startDate.getTime()) / + DayTimes / (3 * new Date(adjusted_date.getFullYear(), adjusted_date.getMonth() + 1, 0).getDate()); break; case 'year':