From 87b947d174695719fb7f89b32f824ca74d5eb640 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Wed, 28 Feb 2024 16:08:50 -0800 Subject: [PATCH] Fixed date buttons for today/yesterday selection. --- src/lib/date.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/date.ts b/src/lib/date.ts index cf2f09df..79dd8976 100644 --- a/src/lib/date.ts +++ b/src/lib/date.ts @@ -263,6 +263,13 @@ export function getOffsetDateRange(dateRange: DateRange, increment: number) { const { unit: originalUnit } = parseDateValue(value) || {}; switch (originalUnit) { + case 'day': + return { + ...dateRange, + startDate: addDays(startDate, increment), + endDate: addDays(endDate, increment), + offset: offset + increment, + }; case 'week': return { ...dateRange,