Skip to content

A local-first personal finance app

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

Matt Fiddamanc621f68e0ab8
diff --git a/packages/desktop-client/src/components/reports/Header.tsx b/packages/desktop-client/src/components/reports/Header.tsx
index f3cdc0fd93..9529693a52 100644
--- a/packages/desktop-client/src/components/reports/Header.tsx
+++ b/packages/desktop-client/src/components/reports/Header.tsx
@@ -160,7 +160,7 @@ export function Header({
{show1Month && (
<Button
variant="bare"
- onPress={() => onChangeDates(...getLatestRange(1))}
+ onPress={() => onChangeDates(...getLatestRange(0))}
>
<Trans>1 month</Trans>
</Button>
diff --git a/packages/desktop-client/src/components/reports/reportRanges.ts b/packages/desktop-client/src/components/reports/reportRanges.ts
index 8122aa0f09..a3ff727caa 100644
--- a/packages/desktop-client/src/components/reports/reportRanges.ts
+++ b/packages/desktop-client/src/components/reports/reportRanges.ts
@@ -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;
}
diff --git a/upcoming-release-notes/5495.md b/upcoming-release-notes/5495.md
new file mode 100644
index 0000000000..109e74a480
--- /dev/null
+++ b/upcoming-release-notes/5495.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [matt-fidd]
+---
+
+Fix live report date mode not supporting a 2 month window