timetable-app

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit f12d8264acf759be1f064bc951beac08fd70240a
parent 02cc2cccb4d8c6cf5947fec12a9b736c907db15a
Author: Yuukin256 <52195426+Yuukin256@users.noreply.github.com>
Date:   Wed, 11 Dec 2024 01:34:24 +0900

授業・イベントがない日に時間割を表示しないように変更 (#86)

* クラス時間割変換ツールの出力形式を修正

* #84 授業・イベントが無い日はAPIがデータを返さないように変更
Diffstat:
Msrc/client/features/tools/classStandardExcelToCode/hooks/useClassStandardDataOutput.ts | 1-
Msrc/server/routers/dayPeriodSchedule.ts | 4+++-
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/client/features/tools/classStandardExcelToCode/hooks/useClassStandardDataOutput.ts b/src/client/features/tools/classStandardExcelToCode/hooks/useClassStandardDataOutput.ts @@ -34,7 +34,6 @@ const useDayPeriodDataOutput = (): Result => { output[gradeClass][dayPeriod] = subjects .split('/') .map((subject) => ({ - dayPeriod, shortName: subject, })); } diff --git a/src/server/routers/dayPeriodSchedule.ts b/src/server/routers/dayPeriodSchedule.ts @@ -28,7 +28,9 @@ export const dayPeriodScheduleRouter = router({ .map(([date, allGradesSchedule]): [string, DayScheduleWithDate] => { const schedule = { ...allGradesSchedule[`grade${input.grade}`] }; return [date, { date: new Date(date), ...schedule }]; - }); + }) + // 日付以外のデータがある日のみ + .filter(([, schedule]) => Object.values(schedule).length > 1); return schedules; }),