From e79315db4a67ffa9cebbace1a7a7b864c818e877 Mon Sep 17 00:00:00 2001 From: prestoncraw Date: Mon, 14 Sep 2026 12:31:16 -0400 Subject: [PATCH] Use hours as unit when finding center to avoid rounding issues --- .../Scripts/TSX/Components/EventSearch/TimeWindowUtils.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PQBrowser/Scripts/TSX/Components/EventSearch/TimeWindowUtils.tsx b/PQBrowser/Scripts/TSX/Components/EventSearch/TimeWindowUtils.tsx index 28e04ad0..239db292 100644 --- a/PQBrowser/Scripts/TSX/Components/EventSearch/TimeWindowUtils.tsx +++ b/PQBrowser/Scripts/TSX/Components/EventSearch/TimeWindowUtils.tsx @@ -51,7 +51,8 @@ export function fromGemstoneFilter(start: string, end: string, unit: string, dur window = duration / 2; windowUnit = unitNumber(unit); } - const center = startTime.clone().add(moment.duration(window, momentUnit(windowUnit))); + // Use hours to preserve fractional days and match getStartEndTime without calendar-unit rounding. + const center = startTime.clone().add(moment.duration(window, momentUnit(windowUnit)).asHours(), 'h'); return { date: center.format(momentDateFormat), time: center.format(momentTimeFormat),