Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,8 @@
opacity: 0;
}
}

/* MonthPicker clear button 제거 */
input[type="month"]::-webkit-clear-button {
display: none;
}
5 changes: 3 additions & 2 deletions src/pages/Schedule/ScheduleDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { formatScheduleTime } from '@/utils/hooks/useFormatTime';
import { useScheduleList } from './hooks/useGetSchedules';

type scheduleDetailProps = {
year: number;
month: number;
day: number;
};
Expand All @@ -14,8 +15,8 @@ const SCHEDULE_COLOR = {
DORM: '#B9ADEF',
};

function ScheduleDetail({ month, day }: scheduleDetailProps) {
const { data: schedules } = useScheduleList({ year: new Date().getFullYear(), month });
function ScheduleDetail({ year, month, day }: scheduleDetailProps) {
const { data: schedules } = useScheduleList({ year, month });

const parseDateOnly = (value: string) => {
const [date] = value.split(' ');
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Schedule/components/MonthPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function MonthPicker({
};

return (
<div className="relative flex w-[140px] items-center">
<div className="relative flex items-center">
<input
ref={inputRef}
type="month"
Expand Down
5 changes: 3 additions & 2 deletions src/pages/Schedule/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,15 @@ function Schedule() {
{ replace: true }
);
};

const schedulesByDate = (date: Date): Schedule[] => {
return schedules.filter((s) => isDateInRange(date, s.startedAt, s.endedAt));
};

return (
<div className="flex h-[calc(100vh-44px)] flex-col bg-white">
<main className="flex w-full shrink-0 flex-col gap-6 bg-white">
<header className="flex justify-center gap-5">
<header className="flex items-center justify-center">
<MonthPicker year={year} month={month} setDate={setDate} />
</header>

Expand All @@ -94,7 +95,7 @@ function Schedule() {
</main>

<section className="flex-1 overflow-y-auto">
<ScheduleDetail month={month} day={day} />
<ScheduleDetail year={year} month={month} day={day} />
</section>
</div>
);
Expand Down