Skip to content

Commit

Permalink
๐Ÿ‘ฝ ์‹œ๊ฐ„ํ‘œ ์ž๋™์กฐ์ • ๋กœ์ง ํด๋ผ๋ž‘ ํ†ต์ผ ๋ฐ ์ข…๋ฃŒ์‹œ๊ฐ„ ๋ฒ„๊ทธ ์ˆ˜์ • (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
woohm402 authored Sep 12, 2023
1 parent 9f49f38 commit f88f308
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const createTimetableViewService = (): TimetableViewService => {
},
getHourRange: (timetable) => {
const times = timetable.lectures.flatMap((l) => l.classPlaceAndTimes);
const start = Math.min(...times.map((t) => Math.floor(t.startMinute / 60)), 8) as Hour;
const end = Math.max(...times.map((t) => Math.ceil(t.endMinute / 60)), 22) as Hour;
const start = Math.min(...times.map((t) => Math.floor(t.startMinute / 60)), 9) as Hour;
const end = Math.max(...times.map((t) => Math.floor(t.endMinute / 60)), 17) as Hour;
return [start, end];
},
getDayLabel: (day) => ({ 0: '์›”', 1: 'ํ™”', 2: '์ˆ˜', 3: '๋ชฉ', 4: '๊ธˆ', 5: 'ํ† ', 6: '์ผ' })[day],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { FullTimetable } from '../entities/timetable';

export type TimetableViewService = {
getDayRange: (table: Pick<FullTimetable, 'lectures'>) => [Day, Day];
getHourRange: (table: Pick<FullTimetable, 'lectures'>) => [Hour, Hour];
getHourRange: (table: Pick<FullTimetable, 'lectures'>) => [Hour, Hour]; // Note: [9, 17] ์ด๋ฉด 9:00 ~ 17:59 ๋ฅผ ์˜๋ฏธํ•œ๋‹ค
getDayLabel: (day: Day) => string;
getLessonColor: (lesson: FullTimetable['lectures'][number], palette: Color[]) => { bg: string; fg: string };
};

0 comments on commit f88f308

Please sign in to comment.