Fixed date buttons for today/yesterday selection.

This commit is contained in:
Mike Cao 2024-02-28 16:08:50 -08:00
parent 300a0f63e7
commit 87b947d174

View File

@ -263,6 +263,13 @@ export function getOffsetDateRange(dateRange: DateRange, increment: number) {
const { unit: originalUnit } = parseDateValue(value) || {}; const { unit: originalUnit } = parseDateValue(value) || {};
switch (originalUnit) { switch (originalUnit) {
case 'day':
return {
...dateRange,
startDate: addDays(startDate, increment),
endDate: addDays(endDate, increment),
offset: offset + increment,
};
case 'week': case 'week':
return { return {
...dateRange, ...dateRange,