diff --git a/components/Calendar.tsx b/components/Calendar.tsx index 222dd8a..d2a1427 100644 --- a/components/Calendar.tsx +++ b/components/Calendar.tsx @@ -2,12 +2,13 @@ import Link from "next/link"; export const Calendar = () => { const header = ['일', '월', '화', '수', '목', '금', '토'] - const july = Array.from(Array(5), () => Array(7).fill(0)) + const july: number[][] = Array.from(Array(5), () => Array(7).fill(0)) const julyStartIdx = 1; const julyDays = 31; for (let i = julyStartIdx, day = 1; day <= julyDays; i++, day++) july[Math.floor(i / 7)][i % 7] = day const exodus = [null, '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23-24', '25-26', '27-28', '29-30', '31-32', '33-34', '35-36', '37-38', '39-40'] + const today = new Date(); const setDayColor = (idx: number) => `${idx === 0 ? 'text-red-500' : ''} ${idx === 6 ? 'text-blue-600' : ''}` @@ -21,10 +22,10 @@ export const Calendar = () => {
- {july.map((row, i) => ( + {july.map((row: number[], i) => (
- {row.map((day, i) => ( - + {row.map((day: number, i) => ( + {day ?
{day}