From 5b8777ec2eefd577be677934e881cad64ed18181 Mon Sep 17 00:00:00 2001 From: fangsmile <892739385@qq.com> Date: Sun, 26 Jan 2025 17:55:13 +0800 Subject: [PATCH 1/2] fix: updateScales to quarter taskbar size error #3348 --- packages/vtable-gantt/src/tools/util.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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': From fa90c96a409acf6840ae1bd2e47b42e6841e8e7c Mon Sep 17 00:00:00 2001 From: fangsmile <892739385@qq.com> Date: Sun, 26 Jan 2025 17:55:40 +0800 Subject: [PATCH 2/2] docs: update changlog of rush --- ...bug-vtable-gantt-updateScale_2025-01-26-09-55.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 common/changes/@visactor/vtable/3348-bug-vtable-gantt-updateScale_2025-01-26-09-55.json 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