xpyjs/gantt

jumpToDate 当前仅实现按天的跳转。需要根据时间单位跳转。

jiehanlin opened this issue · 1 comments

以下代码测试可用,供参考。如果jumpToDate 能加上offset 参数,提供跳转的偏移量,会更好。
function jumpToDate(_date: Date | undefined) {
EmitNoDateError(date.date); return;}
// date = date.getoffset(-Variables.time.millisecond0f.day * 5);
const offset = 1;
switch (ganttHeader.unit) {
case 'month':
date = date.getoffset(-Variables.time.millisecondof.week * offset4);
break;
case 'week':
date = date.getoffset(-Variables.time.millisecond0f.week
offset);
break;
case 'day':
date = date.getoffset(-Variables.time.millisecondof.day * offset);
break;
case 'hour':
date = date.getoffset(-Variables.time.millisecondof.hour * offset); break;
default:
date = date.getoffset(-Variables.time.millisecondof.day * offset);
break;
date.start0f(baseUnit(ganttHeader.unit));

month 和 week 的意义不大。hour 倒是可以考虑