diff --git a/apps/member/src/components/calendar/CalendarSchedule/CalendarSchedule.tsx b/apps/member/src/components/calendar/CalendarSchedule/CalendarSchedule.tsx index c30a2d73..098d8a96 100644 --- a/apps/member/src/components/calendar/CalendarSchedule/CalendarSchedule.tsx +++ b/apps/member/src/components/calendar/CalendarSchedule/CalendarSchedule.tsx @@ -18,18 +18,18 @@ const CalendarSchedule = ({ day, title, detail, - startDate, - endDate, + startDateTime, + endDateTime, }: CalendarScheduleProps) => { const { openModal } = useModal(); - const isDateDiff = dayjs(startDate).diff(endDate, 'd'); + const isDateDiff = dayjs(startDateTime).diff(endDateTime, 'd'); const isBeforeToday = day.isBefore(today, 'day'); const handleScheduleClick = useCallback( - (detail: string, startDate: string, endDate: string) => { + (detail: string, startDateTime: string, endDateTime: string) => { openModal({ title: 'πŸ“† 일정', - content: `μΌμ‹œ: ${formattedDatePeriod(startDate, endDate)}\nλ‚΄μš©: ${detail}`, + content: `μΌμ‹œ: ${formattedDatePeriod(startDateTime, endDateTime)}\nλ‚΄μš©: ${detail}`, }); }, [openModal], @@ -42,21 +42,21 @@ const CalendarSchedule = ({ isDateDiff === 0 ? 'rounded bg-blue-100' : 'bg-red-100', { 'rounded-l bg-red-100': - isDateDiff !== 0 && day.isSame(startDate, 'date'), + isDateDiff !== 0 && day.isSame(startDateTime, 'date'), }, { 'bg-red-100': isDateDiff !== 0 && - day.isAfter(startDate, 'date') && - day.isBefore(endDate, 'date'), + day.isAfter(startDateTime, 'date') && + day.isBefore(endDateTime, 'date'), }, { 'rounded-r bg-red-100': - isDateDiff !== 0 && day.isSame(endDate, 'date'), + isDateDiff !== 0 && day.isSame(endDateTime, 'date'), }, { 'opacity-50': isBeforeToday }, )} - onClick={() => handleScheduleClick(detail, startDate, endDate)} + onClick={() => handleScheduleClick(detail, startDateTime, endDateTime)} > {title} diff --git a/apps/member/src/components/calendar/CalendarStatusSection/CalendarStatusSection.tsx b/apps/member/src/components/calendar/CalendarStatusSection/CalendarStatusSection.tsx index 01cb34de..0c2d502c 100644 --- a/apps/member/src/components/calendar/CalendarStatusSection/CalendarStatusSection.tsx +++ b/apps/member/src/components/calendar/CalendarStatusSection/CalendarStatusSection.tsx @@ -16,8 +16,8 @@ const CalendarStatusSection = () => { const { data: yearData } = useScheduleCollect(); const closestEvent = findClosestEvent(transformEvents(monthData.items)); - const closestDDay = closestEvent?.startDate - ? `D-${calculateDDay(closestEvent.startDate)}` + const closestDDay = closestEvent?.startDateTime + ? `D-${calculateDDay(closestEvent.startDateTime)}` : '이번 달에 남은 일정이 μ—†μ–΄μš”'; return ( diff --git a/apps/member/src/components/calendar/CalendarTableSection/CalendarTableSection.tsx b/apps/member/src/components/calendar/CalendarTableSection/CalendarTableSection.tsx index 0dccfdec..e8ed74f4 100644 --- a/apps/member/src/components/calendar/CalendarTableSection/CalendarTableSection.tsx +++ b/apps/member/src/components/calendar/CalendarTableSection/CalendarTableSection.tsx @@ -14,10 +14,10 @@ const CalendarTableSection = () => { const { data } = useSchedule(); const handleScheduleClick = useCallback( - (detail: string, startDate: string, endDate: string) => { + (detail: string, startDateTime: string, endDateTime: string) => { openModal({ title: 'πŸ“† 일정', - content: `μΌμ‹œ: ${formattedDatePeriod(startDate, endDate)}\nλ‚΄μš©: ${detail}`, + content: `μΌμ‹œ: ${formattedDatePeriod(startDateTime, endDateTime)}\nλ‚΄μš©: ${detail}`, }); }, [openModal], @@ -26,12 +26,14 @@ const CalendarTableSection = () => { return (
- {data.items.map(({ id, title, detail, startDate, endDate }) => ( + {data.items.map(({ id, title, detail, startDateTime, endDateTime }) => ( handleScheduleClick(detail, startDate, endDate)} + onClick={() => + handleScheduleClick(detail, startDateTime, endDateTime) + } > - {`${formattedDate(startDate)} ~ ${formattedDate(endDate)}`} + {`${formattedDate(startDateTime)} ~ ${formattedDate(endDateTime)}`} {title} ))} diff --git a/apps/member/src/components/manage/ManageCalendarSection/ManageCalendarSection.tsx b/apps/member/src/components/manage/ManageCalendarSection/ManageCalendarSection.tsx index 2051e475..ffae40eb 100644 --- a/apps/member/src/components/manage/ManageCalendarSection/ManageCalendarSection.tsx +++ b/apps/member/src/components/manage/ManageCalendarSection/ManageCalendarSection.tsx @@ -54,29 +54,31 @@ const ManageCalendarSection = () => { const renderView = { view: (
- {data.items.map(({ id, title, startDate, endDate, priority }) => ( - - {id} - - {toDecodeHTMLEntities(title)} - - {formattedDate(startDate)} - {formattedDate(endDate)} - {toPriorityText(priority)} - - handleDeleteButtonClick(e, id)} - > - μ‚­μ œ - - - - ))} + {data.items.map( + ({ id, title, startDateTime, endDateTime, priority }) => ( + + {id} + + {toDecodeHTMLEntities(title)} + + {formattedDate(startDateTime)} + {formattedDate(endDateTime)} + {toPriorityText(priority)} + + handleDeleteButtonClick(e, id)} + > + μ‚­μ œ + + + + ), + )}
), add: handleMenubarItemClick('view')} />, diff --git a/apps/member/src/types/schedule.ts b/apps/member/src/types/schedule.ts index ce91160e..5e0b4a5a 100644 --- a/apps/member/src/types/schedule.ts +++ b/apps/member/src/types/schedule.ts @@ -6,8 +6,8 @@ export interface ScheduleItem { title: string; detail: string; activityName: string | null; - startDate: string; - endDate: string; + startDateTime: string; + endDateTime: string; priority: SchedulePriority; } diff --git a/apps/member/src/utils/date.ts b/apps/member/src/utils/date.ts index ad42e76e..5cc4134c 100644 --- a/apps/member/src/utils/date.ts +++ b/apps/member/src/utils/date.ts @@ -80,8 +80,8 @@ export const transformEvents = ( ): Record => { return events.reduce( (acc, current) => { - const startDate = new Date(current.startDate.split('T')[0]); // μ‹œμž‘ λ‚ μ§œ 객체 생성 - const endDate = new Date(current.endDate.split('T')[0]); // μ’…λ£Œ λ‚ μ§œ 객체 생성 + const startDate = new Date(current.startDateTime.split('T')[0]); // μ‹œμž‘ λ‚ μ§œ 객체 생성 + const endDate = new Date(current.endDateTime.split('T')[0]); // μ’…λ£Œ λ‚ μ§œ 객체 생성 for ( let date = new Date(startDate);