mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-11 12:43:09 -05:00
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:
@@ -160,7 +160,7 @@ export function Header({
|
||||
{show1Month && (
|
||||
<Button
|
||||
variant="bare"
|
||||
onPress={() => onChangeDates(...getLatestRange(1))}
|
||||
onPress={() => onChangeDates(...getLatestRange(0))}
|
||||
>
|
||||
<Trans>1 month</Trans>
|
||||
</Button>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
6
upcoming-release-notes/5495.md
Normal file
6
upcoming-release-notes/5495.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfix
|
||||
authors: [matt-fidd]
|
||||
---
|
||||
|
||||
Fix live report date mode not supporting a 2 month window
|
||||
Reference in New Issue
Block a user