1- import { getMonthName } from "../../../common/utils/dateUtils" ;
1+ import {
2+ getDateOrdinal ,
3+ getDayName ,
4+ getMonthName ,
5+ } from "../../../common/utils/dateUtils" ;
26import Button from "../../../components/Button" ;
37import useSystemSettings from "../../../stores/systemSettingsStore" ;
48import {
@@ -7,16 +11,18 @@ import {
711} from "./styles" ;
812
913interface StyledNavigationProps {
10- month : number ;
11- year : number ;
14+ date : Date ;
15+ onClickPrevDay ( ) : void ;
16+ onClickNextDay ( ) : void ;
1217 onClickPrevMonth ( ) : void ;
1318 onClickNextMonth ( ) : void ;
1419 onClickPrevYear ( ) : void ;
1520 onClickNextYear ( ) : void ;
1621}
1722export default function CalendarNavigation ( {
18- month,
19- year,
23+ date,
24+ onClickNextDay,
25+ onClickPrevDay,
2026 onClickNextMonth,
2127 onClickNextYear,
2228 onClickPrevMonth,
@@ -26,6 +32,9 @@ export default function CalendarNavigation({
2632 s . fontColor ,
2733 s . mainColor ,
2834 ] ) ;
35+ const day = date . getDate ( ) ;
36+ const month = date . getMonth ( ) ;
37+ const year = date . getFullYear ( ) ;
2938 return (
3039 < StyledCalendarNavigation className = "calendar__nav" >
3140 < StyledCalendarNavigationSection className = "calendar__nav-section" >
@@ -71,6 +80,28 @@ export default function CalendarNavigation({
7180 group = "horizontal"
7281 > { `>` } </ Button >
7382 </ StyledCalendarNavigationSection >
83+
84+ < StyledCalendarNavigationSection className = "calendar__nav-section" >
85+ < Button
86+ backgroundColor = { buttonColor }
87+ color = { fontColor }
88+ onClick = { onClickPrevDay }
89+ group = "horizontal"
90+ > { `<` } </ Button >
91+ < Button
92+ backgroundColor = { buttonColor }
93+ color = { fontColor }
94+ group = "horizontal"
95+ >
96+ { `${ getDayName ( date ) } ${ getDateOrdinal ( day ) } ` }
97+ </ Button >
98+ < Button
99+ backgroundColor = { buttonColor }
100+ color = { fontColor }
101+ onClick = { onClickNextDay }
102+ group = "horizontal"
103+ > { `>` } </ Button >
104+ </ StyledCalendarNavigationSection >
74105 </ StyledCalendarNavigation >
75106 ) ;
76107}
0 commit comments