xpyjs / gantt

An easy-to-use Gantt component. 持续更新,中文文档
https://docs.xiaopangying.com/gantt/
MIT License
243 stars 41 forks source link

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

Open jiehanlin opened 1 month ago

jiehanlin commented 1 month ago

以下代码测试可用,供参考。如果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.weekoffset); 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));

jeremyjone commented 1 month ago

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