diff --git a/web/components/gantt-chart/chart/year.tsx b/web/components/gantt-chart/chart/year.tsx index 670f4380e..488080ea1 100644 --- a/web/components/gantt-chart/chart/year.tsx +++ b/web/components/gantt-chart/chart/year.tsx @@ -57,13 +57,14 @@ export const YearChartView: FC = () => { className="relative flex h-full flex-col overflow-hidden whitespace-nowrap" style={{ width: `${currentViewData?.data.width}px` }} > -
+ {/*
+ > */} {/* {monthDay?.today && (
)} */} diff --git a/web/components/gantt-chart/views/year-view.ts b/web/components/gantt-chart/views/year-view.ts index 75e2d2a98..60e677fa7 100644 --- a/web/components/gantt-chart/views/year-view.ts +++ b/web/components/gantt-chart/views/year-view.ts @@ -156,12 +156,12 @@ export const getYearChartItemPositionWidthInYear = ( // position code starts const positionTimeDifference: number = startDate.getTime() - itemStartDate.getTime(); - const positionDaysDifference: number = Math.abs( - Math.floor(positionTimeDifference / (1000 * 60 * 60 * 24)) + const positionWeeksDifference: number = Math.abs( + Math.floor(positionTimeDifference / (1000 * 60 * 60 * 24 * 7)) ); - scrollPosition = positionDaysDifference * chartData.data.width; + scrollPosition = positionWeeksDifference * chartData.data.width; - var diffMonths = (itemStartDate.getFullYear() - startDate.getFullYear()) * 12; + let diffMonths = (itemStartDate.getFullYear() - startDate.getFullYear()) * 12; diffMonths -= startDate.getMonth(); diffMonths += itemStartDate.getMonth(); @@ -171,7 +171,7 @@ export const getYearChartItemPositionWidthInYear = ( // width code starts const widthTimeDifference: number = itemStartDate.getTime() - itemTargetDate.getTime(); const widthDaysDifference: number = Math.abs( - Math.floor(widthTimeDifference / (1000 * 60 * 60 * 24)) + Math.floor(widthTimeDifference / (1000 * 60 * 60 * 24 * 7)) ); scrollWidth = (widthDaysDifference + 1) * chartData.data.width + 1; // width code ends