Skip to content

Commit 8d7b873

Browse files
committed
refactor(scheduling): clean up time-slot.ts by removing outdated comments and improving code clarity
1 parent 649338f commit 8d7b873

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

lib/scheduling/time-slot.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@ export const WEEKDAY = {
1515
export type Weekday = keyof typeof WEEKDAY;
1616

1717
export type CalendarDaysConfig = {
18-
/** Number of 7-day periods starting from today (or `anchor`). */
1918
weeks: number;
20-
/** Which weekdays appear as columns (e.g. `['mon', 'tue', 'wed', 'thu', 'fri']`). */
2119
daysOfWeek: Weekday[];
22-
/** Defaults to today at local midnight. */
2320
anchor?: Date;
2421
};
2522

@@ -44,7 +41,6 @@ function isSameLocalDay(a: Date, b: Date): boolean {
4441
);
4542
}
4643

47-
/** Inclusive slot keys between two times on the same local day (for fast drag fill). */
4844
export function getSlotKeysBetween(fromKey: string, toKey: string): string[] {
4945
const from = parseSlotKey(fromKey);
5046
const to = parseSlotKey(toKey);
@@ -85,7 +81,6 @@ export function buildDaySlots(
8581
return slots;
8682
}
8783

88-
/** Merge selected 15-minute keys into `{ start, end }` ranges (ISO strings). */
8984
export function keysToTimeSlots(keys: Iterable<string>): TimeSlot[] {
9085
const sorted = [...keys]
9186
.map(parseSlotKey)
@@ -130,7 +125,6 @@ export function formatHourLabel(hour: number): string {
130125
return `${hour - 12} PM`;
131126
}
132127

133-
/** Stable aria-label text (avoids locale-dependent SSR hydration mismatches). */
134128
export function formatSlotAriaLabel(
135129
date: Date,
136130
hour: number,

0 commit comments

Comments
 (0)