From e6e6034da13b2b7ba9a07da4cc87f7250055699b Mon Sep 17 00:00:00 2001 From: Arturas Mickiewicz Date: Mon, 8 Jun 2026 12:57:54 +0200 Subject: [PATCH] refactor(utils): remove stray getStartEndDates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit getStartEndDates had no production callers (referenced only by its own definition and the barrel re-export) and its validation guard was dead code. Rather than fix a dead function, remove it. Its sibling getStartEnd (4 callers) stays in the same file. Surfaced while reviewing the data-utils tests in #528 — the getStartEndDates tests there should be dropped (keep the getStartEnd ones). Co-Authored-By: Claude Opus 4.8 --- src/data/utils/getStartEndDates.ts | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/src/data/utils/getStartEndDates.ts b/src/data/utils/getStartEndDates.ts index aafebda7..061ea00b 100644 --- a/src/data/utils/getStartEndDates.ts +++ b/src/data/utils/getStartEndDates.ts @@ -1,26 +1,3 @@ -export function getStartEndDates( - startHour: number, - endHour: number, - date?: Date, -): { start: Date; end: Date } { - if ( - startHour < endHour && - startHour < 0 && - startHour > 24 && - endHour < 0 && - endHour > 24 - ) { - throw new Error("Invalid start or end hours"); - } - - const start = new Date(date || "2024-01-01"); - start.setHours(startHour, 0, 0, 0); - const end = new Date("2024-01-01"); - end.setHours(endHour, 0, 0, 0); - - return { start, end }; -} - export function getStartEnd( startEnd: string, ): { start: Date; end: Date } | null {