File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 11import { Card } from '@/components/ui/primitives' ;
2- import { getCurrentDate } from '@/lib/utils' ;
32import { timelineData , TIMELINE_CONFIG } from '@/data/timeline' ;
43
54type TimelineDate = {
@@ -11,7 +10,7 @@ const getTimelineDate = (): TimelineDate => {
1110 const date = new Date ( ) ;
1211 return {
1312 year : date . getFullYear ( ) ,
14- month : 12 ,
13+ month : date . getMonth ( ) + 1 ,
1514 } ;
1615} ;
1716
@@ -23,11 +22,11 @@ const getMonthsSinceStart = (date: TimelineDate) => {
2322// Helper function to calculate grid position percentage
2423const getGridOffsetPercentage = ( date : TimelineDate ) => {
2524 const currentMonths = getMonthsSinceStart ( date ) ;
25+ // Use the same calculation as timeline bars for consistency
26+ const totalMonths = TIMELINE_CONFIG . TOTAL_MONTHS + 12 ;
27+ const percentage = ( currentMonths / totalMonths ) * 100 ;
2628
27- // Adjust for grid
28- // Each column represents 12 months, so we need to map the percentage to the grid
29- const gridOffset = ( currentMonths / 12 ) / ( TIMELINE_CONFIG . END_YEAR - TIMELINE_CONFIG . START_YEAR + 1 ) * 100 ;
30- return gridOffset ;
29+ return percentage ;
3130}
3231
3332const getGridRange = (
You can’t perform that action at this time.
0 commit comments