[PR #6222] add "last month" mode date filter to reports #6392

Closed
opened 2026-02-28 21:27:41 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/actualbudget/actual/pull/6222

State: closed
Merged: Yes



category: Enhancements
authors: [espege]

Adds date filter "Last Month" on non-custom reports. Feature already available for custom reports.

Justification

In reports, users that do not have live data rely on imported data which is usually from the past month.

Being able to target last month in reports is very useful to ensure reports are showing only relevant information, and are not showing empty or irrelevant information.

Changes

This PR adds the "Last Month" date filter for reports that are not currently offering this option.

Current Behavior

Currently, Custom Reports support "last month" date filter as shown below:
Capture d’écran, le 2025-11-21 à 10 13 15

New Behavior

With this PR, "last month" is also a filter in calculated reports.

Capture d’écran, le 2025-11-21 à 06 47 10

This includes experimental function "Formula Card"
Capture d’écran, le 2025-11-21 à 10 25 55

Net Worth report specifics

Net worth report was designed to default to a monthly visual breakdown, causing bad display results for "last month". Function getDefaultIntervalForMode was added to ensure that weekly is selected when time filter is set to last month, but otherwise defaults to monthly as per original behavior.

networth


Note

Adds a "Last month" date range across reports and formula queries, with Net Worth defaulting to weekly interval for this mode.

  • Reports UI:
    • Add "Last month" quick-select in components/reports/Header.tsx and disable-include entry in components/reports/disabledList.ts.
    • Extend getLiveRange to handle lastMonth.
  • Formula/Queries:
    • Add "Last month" option in components/formula/QueryManager.tsx quick menu.
    • Map TimeFrame['mode'] to "Last month" in hooks/useFormulaExecution.ts.
  • Types:
    • Extend TimeFrame['mode'] with lastMonth in loot-core/src/types/models/dashboard.ts.
  • Net Worth report:
    • Introduce getDefaultIntervalForMode and default to Weekly when mode is lastMonth; otherwise keep monthly defaults.
  • Docs:
    • Add release note upcoming-release-notes/6222.md for the new date filter.

Written by Cursor Bugbot for commit 01d778db3b. This will update automatically on new commits. Configure here.

**Original Pull Request:** https://github.com/actualbudget/actual/pull/6222 **State:** closed **Merged:** Yes --- --- category: Enhancements authors: [espege] --- Adds date filter "Last Month" on non-custom reports. Feature already available for custom reports. ## Justification In reports, users that do not have live data rely on imported data which is usually from the past month. Being able to target last month in reports is very useful to ensure reports are showing only relevant information, and are not showing empty or irrelevant information. ## Changes This PR adds the "Last Month" date filter for reports that are not currently offering this option. ### Current Behavior Currently, Custom Reports support "last month" date filter as shown below: <img width="2257" height="1263" alt="Capture d’écran, le 2025-11-21 à 10 13 15" src="https://github.com/user-attachments/assets/a839b867-8198-46d1-b552-319830233176" /> ### New Behavior With this PR, "last month" is also a filter in calculated reports. <img width="1345" height="606" alt="Capture d’écran, le 2025-11-21 à 06 47 10" src="https://github.com/user-attachments/assets/4754ee26-3158-47fe-b268-d792724aa6e8" /> This includes experimental function "Formula Card" <img width="2246" height="798" alt="Capture d’écran, le 2025-11-21 à 10 25 55" src="https://github.com/user-attachments/assets/a98bb34d-d3d1-4143-880b-23ac42352d3c" /> ### Net Worth report specifics Net worth report was designed to default to a monthly visual breakdown, causing bad display results for "last month". Function _getDefaultIntervalForMode_ was added to ensure that weekly is selected when time filter is set to last month, but otherwise defaults to monthly as per original behavior. ![networth](https://github.com/user-attachments/assets/c2e611ba-d1b1-4ef8-9511-5931e9fdadc7) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds a "Last month" date range across reports and formula queries, with Net Worth defaulting to weekly interval for this mode. > > - **Reports UI**: > - Add "Last month" quick-select in `components/reports/Header.tsx` and disable-include entry in `components/reports/disabledList.ts`. > - Extend `getLiveRange` to handle `lastMonth`. > - **Formula/Queries**: > - Add "Last month" option in `components/formula/QueryManager.tsx` quick menu. > - Map `TimeFrame['mode']` to "Last month" in `hooks/useFormulaExecution.ts`. > - **Types**: > - Extend `TimeFrame['mode']` with `lastMonth` in `loot-core/src/types/models/dashboard.ts`. > - **Net Worth report**: > - Introduce `getDefaultIntervalForMode` and default to `Weekly` when mode is `lastMonth`; otherwise keep monthly defaults. > - **Docs**: > - Add release note `upcoming-release-notes/6222.md` for the new date filter. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 01d778db3b847526cd2b299a2dd0fa0ee10a8826. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
GiteaMirror added the pull-request label 2026-02-28 21:27:41 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#6392