diff --git a/packages/lsd-react/src/components/Calendar/Month.tsx b/packages/lsd-react/src/components/Calendar/Month.tsx index 93cb99d..c78615a 100644 --- a/packages/lsd-react/src/components/Calendar/Month.tsx +++ b/packages/lsd-react/src/components/Calendar/Month.tsx @@ -47,6 +47,12 @@ export const Month = ({ return date.getDate() } + const getDay = (index: number) => + days[index] as { + dayLabel: string + date: Date + } + useClickAway(ref, (event) => { if (!changeYear) return @@ -127,8 +133,8 @@ export const Month = ({ .map((_, idx) => ( ))} @@ -137,12 +143,12 @@ export const Month = ({ ) : ( day === 0).length, - days[days.lastIndexOf(0) + 1].date, + getDay(days.lastIndexOf(0) + 1).date, ).toString()} - key={`prev-${idx}`} + key={`current-${idx}`} disabled={true} /> ), @@ -155,10 +161,10 @@ export const Month = ({ .fill(null) .map((ele, idx) => (