달력에서 카테고리 필터 적용

- PC/모바일 일정 페이지 달력의 점에 카테고리 필터 적용
- 선택된 카테고리의 일정만 달력에 점으로 표시

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
caadiq 2026-01-21 11:50:13 +09:00
parent d1250124a7
commit 0c278597c0
2 changed files with 10 additions and 4 deletions

View file

@ -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 (

View file

@ -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 (