diff --git a/frontend/src/pages/mobile/public/Schedule.jsx b/frontend/src/pages/mobile/public/Schedule.jsx index f833d5e..e6ba6c3 100644 --- a/frontend/src/pages/mobile/public/Schedule.jsx +++ b/frontend/src/pages/mobile/public/Schedule.jsx @@ -686,9 +686,13 @@ function MobileSchedule() { const day = String(date.getDate()).padStart(2, '0'); const dateStr = `${year}-${month}-${day}`; - // 해당 날짜의 일정 목록 (최대 3개) + // 해당 날짜의 일정 목록 (최대 3개, 카테고리 필터 적용) const daySchedules = schedules - .filter(s => s.date?.split('T')[0] === dateStr) + .filter(s => { + const matchesDate = s.date?.split('T')[0] === dateStr; + const matchesCategory = selectedCategories.length === 0 || selectedCategories.includes(s.category_id); + return matchesDate && matchesCategory; + }) .slice(0, 3); return ( diff --git a/frontend/src/pages/pc/public/Schedule.jsx b/frontend/src/pages/pc/public/Schedule.jsx index c04d0d1..d32a097 100644 --- a/frontend/src/pages/pc/public/Schedule.jsx +++ b/frontend/src/pages/pc/public/Schedule.jsx @@ -804,11 +804,13 @@ function Schedule() { const dayOfWeek = (firstDay + i) % 7; const isToday = new Date().toDateString() === new Date(year, month, day).toDateString(); - // 해당 날짜의 일정 목록 (점 표시용, 최대 3개) + // 해당 날짜의 일정 목록 (점 표시용, 최대 3개, 카테고리 필터 적용) const daySchedules = schedules.filter(s => { const scheduleDate = s.date ? s.date.split('T')[0] : ''; const dateStr = `${year}-${String(month + 1).padStart(2, '0')}-${String(day).padStart(2, '0')}`; - return scheduleDate === dateStr; + const matchesDate = scheduleDate === dateStr; + const matchesCategory = selectedCategories.length === 0 || selectedCategories.includes(s.category_id); + return matchesDate && matchesCategory; }).slice(0, 3); return (