fix live report date mode not supporting a 2 month window (#5495)

* allow live report date ranges 2 months wide

* note
This commit is contained in:
Matt Fiddaman
2025-08-05 23:19:54 -04:00
committed by GitHub
parent 4f611ca458
commit c621f68e0a
3 changed files with 9 additions and 5 deletions

View File

@@ -160,7 +160,7 @@ export function Header({
{show1Month && (
<Button
variant="bare"
onPress={() => onChangeDates(...getLatestRange(1))}
onPress={() => onChangeDates(...getLatestRange(0))}
>
<Trans>1 month</Trans>
</Button>

View File

@@ -161,10 +161,8 @@ export function getFullRange(start: string) {
export function getLatestRange(offset: number) {
const end = monthUtils.currentMonth();
let start = end;
if (offset !== 1) {
start = monthUtils.subMonths(end, offset);
}
const start = monthUtils.subMonths(end, offset);
return [start, end, 'sliding-window'] as const;
}

View File

@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [matt-fidd]
---
Fix live report date mode not supporting a 2 month window