File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 77 webLightTheme ,
88} from '@fluentui/react-components' ;
99import { ICalendarStyles , useCalendarStyles } from './hooks/useCalendarStyles' ;
10- import { addDays , startOfMonth , startOfWeek } from 'date-fns' ;
10+ import { addDays , startOfMonth , startOfWeek , format } from 'date-fns' ;
1111import { useEffect , useRef , useState } from 'react' ;
1212
1313import { Day } from './Day' ;
@@ -213,8 +213,9 @@ export const Calendar: React.FC<ICalendarControlProps> = ({
213213 currentDate . getFullYear ( ) ,
214214 currentDate . getMonth ( )
215215 ) ;
216- const dayString = date . toISOString ( ) . split ( 'T' ) [ 0 ] ;
217- return monthEvents [ dayString ] ?. flatMap ( ( slot ) => slot ) || [ ] ;
216+ const dayString = format ( date , 'yyyy-MM-dd' ) ;
217+ const dayEvents = monthEvents [ dayString ] ?. flatMap ( ( slot ) => slot ) || [ ] ;
218+ return dayEvents ;
218219 } ,
219220 [ currentDate , events ]
220221 ) ;
You can’t perform that action at this time.
0 commit comments