Skip to content
This repository was archived by the owner on Aug 2, 2025. It is now read-only.

Commit a91ee0e

Browse files
committed
fix: don't show week if null or undefined
1 parent bd05e49 commit a91ee0e

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

apps/client/src/routes/Main/Home/DaySelect.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ export default function DaySelect({
5454
year: "numeric",
5555
month: "numeric",
5656
day: "numeric",
57-
})} Wk ${
58-
date ? `${day?.[date]?.week}${day?.[date]?.weekType}` : ""
57+
})} ${
58+
date && day?.[date]?.week && day?.[date]?.weekType
59+
? `Wk ${day?.[date]?.week}${day?.[date]?.weekType}`
60+
: ""
5961
}`
6062
: "Select date"}
6163
</Button>

apps/client/src/services/sbhsApi/schemas.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,10 +293,10 @@ export const sbhsKey =
293293

294294
export const daySchema = z.record(
295295
z.object({
296-
date: z.coerce.string(),
297-
term: z.coerce.string(),
298-
week: z.coerce.string(),
299-
weekType: z.coerce.string(),
300-
dayNumber: z.coerce.string(),
296+
date: z.string(),
297+
term: z.coerce.number().nullish(),
298+
week: z.coerce.number().nullish(),
299+
weekType: z.string().length(1).nullish(),
300+
dayNumber: z.coerce.number().nullish(),
301301
})
302302
);

0 commit comments

Comments
 (0)