Skip to content

Fix date format interfering with month filter edit#6497

Merged
youngcw merged 1 commit intoactualbudget:masterfrom
Faizanq:fix/date-format-filter-issue-6341
Jan 6, 2026
Merged

Fix date format interfering with month filter edit#6497
youngcw merged 1 commit intoactualbudget:masterfrom
Faizanq:fix/date-format-filter-issue-6341

Conversation

@Faizanq
Copy link
Copy Markdown
Contributor

@Faizanq Faizanq commented Dec 27, 2025

Summary

  • Fix month filter edit popup showing date in wrong format for non-default date formats
  • The edit popup was always displaying dates in mm/yyyy format regardless of user's date format preference
  • Now respects the configured date format setting

Test plan

  • Set date format to YYYY-MM-DD in Settings
  • Go to any account transactions
  • Add a Month filter (e.g., 2025-12)
  • Click on the filter badge to edit it
  • Verify the input shows "2025-12" (not "12/2025")

Fixes #6341

Summary by CodeRabbit

  • Bug Fixes
    • Fixed month filter edit popup displaying dates in the wrong format when using non-default date format settings.

✏️ Tip: You can customize this high-level summary in your review settings.

@actual-github-bot actual-github-bot bot changed the title Fix date format interfering with month filter edit [WIP] Fix date format interfering with month filter edit Dec 27, 2025
@netlify
Copy link
Copy Markdown

netlify bot commented Dec 27, 2025

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit d3f10db
🔍 Latest deploy log https://app.netlify.com/projects/actualbudget/deploys/694f8db1b8a31f00086132f9
😎 Deploy Preview https://deploy-preview-6497.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Dec 27, 2025

Deploy Preview for actualbudget-website canceled.

Name Link
🔨 Latest commit d3f10db
🔍 Latest deploy log https://app.netlify.com/projects/actualbudget-website/deploys/694f8db10f831d0008a0ce4a

The month filter edit popup was always displaying dates in mm/yyyy format
regardless of user's date format preference. Now respects the configured
date format setting.

Fixes actualbudget#6341
@Faizanq Faizanq force-pushed the fix/date-format-filter-issue-6341 branch from 573f8bf to d3f10db Compare December 27, 2025 07:41
@Faizanq Faizanq changed the title [WIP] Fix date format interfering with month filter edit Fix date format interfering with month filter edit Dec 27, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 27, 2025

📝 Walkthrough

Walkthrough

This change fixes a bug where the month filter edit popup displayed dates in an incorrect format when non-default date formats were configured. The fix leverages the user's preferred date format via useDateFormat() to properly parse and format month/year values, replacing hardcoded format assumptions.

Changes

Cohort / File(s) Summary
Month Filter Format Fix
packages/desktop-client/src/components/filters/FiltersMenu.tsx
Introduces useDateFormat() hook with fallback, replaces manual string split with yyyy-MM parsing, applies getMonthYearFormat(dateFormat) for formatting, adds invalid date validation guard, and updates memoization dependencies to include dateFormat.
Release Documentation
upcoming-release-notes/6497.md
Adds new release note documenting the bugfix for month filter popup displaying dates in wrong format for non-default date formats.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A date format mix-up, we've hopped to repair,
The month filter now shines with the utmost of care,
No more format confusion, the user's choice reigns,
With parsing and formatting, we've eased all the pains! 📅✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main fix: the month filter edit now respects the user's date format preference.
Linked Issues check ✅ Passed The code changes directly address issue #6341 by using useDateFormat() to respect the user's configured date format when formatting month/year values in the edit popup.
Out of Scope Changes check ✅ Passed All changes are focused on fixing the date format issue in the month filter edit popup; no out-of-scope modifications are present.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f6bdc71 and d3f10db.

📒 Files selected for processing (2)
  • packages/desktop-client/src/components/filters/FiltersMenu.tsx
  • upcoming-release-notes/6497.md
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Use TypeScript for all code
Use descriptive variable names with auxiliary verbs (e.g., 'isLoaded', 'hasError')
Use named exports for components and utilities; avoid default exports except in specific cases
Use functional and declarative programming patterns - avoid classes
Use the 'function' keyword for pure functions
Structure files with: exported component/page, helpers, static content, types
Organize imports in the following order: React imports, built-in Node.js modules, external packages, Actual packages, parent imports, sibling imports, index imports, with newlines between groups
Never use 'console.*' - use logger instead (enforced by ESLint rule 'actual/prefer-logger-over-console')
Never import from 'uuid' without destructuring - use 'import { v4 as uuidv4 } from 'uuid''

Files:

  • packages/desktop-client/src/components/filters/FiltersMenu.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Prefer 'type' over 'interface' for defining types in TypeScript
Avoid 'enum' - use objects or maps instead
Avoid 'any' or 'unknown' unless absolutely necessary
Avoid type assertions ('as', '!') - prefer 'satisfies' for type narrowing
Use inline type imports: 'import { type MyType } from '...''
Look for existing type definitions in 'packages/loot-core/src/types/' before creating new types

Files:

  • packages/desktop-client/src/components/filters/FiltersMenu.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{tsx,jsx}: Create new components in their own files
Don't use 'React.FunctionComponent' or 'React.FC' - type props directly
Don't use 'React.*' patterns - use named imports instead
Use '' instead of '' tags in React components
Avoid unstable nested components
Use 'satisfies' for type narrowing in React components
Use declarative JSX that is minimal and readable; avoid unnecessary curly braces in conditionals
Prefer explicit expressions ('condition && ') in JSX
Never import colors directly - use theme instead
Use 'Trans' component instead of 't()' function when possible for internationalization
All user-facing strings must be translated using i18n

Files:

  • packages/desktop-client/src/components/filters/FiltersMenu.tsx
packages/desktop-client/src/**/*.{tsx,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/desktop-client/src/**/*.{tsx,jsx}: Use custom hooks from 'src/hooks' instead of react-router directly (e.g., 'useNavigate()' from 'src/hooks')
Use 'useDispatch()', 'useSelector()', 'useStore()' from 'src/redux' instead of react-redux

Files:

  • packages/desktop-client/src/components/filters/FiltersMenu.tsx
🧠 Learnings (3)
📓 Common learnings
Learnt from: misu-dev
Repo: actualbudget/actual PR: 5167
File: packages/desktop-client/src/components/spreadsheet/useFormat.ts:64-72
Timestamp: 2025-06-16T17:45:40.807Z
Learning: The user misu-dev prefers strict type checking for financial format types in useFormat.ts as a long-term goal, but acknowledges that creating follow-up issues for cleanup should wait until after the current PR is merged, not during the development phase.
📚 Learning: 2024-10-05T10:58:55.008Z
Learnt from: MatissJanis
Repo: actualbudget/actual PR: 3570
File: packages/desktop-client/src/components/modals/ImportTransactionsModal/utils.ts:16-24
Timestamp: 2024-10-05T10:58:55.008Z
Learning: In `packages/desktop-client/src/components/modals/ImportTransactionsModal/utils.ts`, the `parseDate` function's `str` parameter should maintain its current type `string | number | null | Array<unknown> | object`, as narrowing it to `string | null` is not suitable.

Applied to files:

  • packages/desktop-client/src/components/filters/FiltersMenu.tsx
📚 Learning: 2025-12-16T21:27:47.818Z
Learnt from: MatissJanis
Repo: actualbudget/actual PR: 6428
File: eslint.config.mjs:249-278
Timestamp: 2025-12-16T21:27:47.818Z
Learning: Enforce the specified import order for all TypeScript/JavaScript files under packages/desktop-client: React imports, then built-in Node.js modules, then external packages, then loot-core packages, then parent imports, then sibling imports, then index imports, and finally desktop-client imports (desktop-client imports come after relative imports, not before). Apply this rule to all relevant files in that directory (extensions: .ts, .tsx, .js, .mjs).

Applied to files:

  • packages/desktop-client/src/components/filters/FiltersMenu.tsx
🧬 Code graph analysis (1)
packages/desktop-client/src/components/filters/FiltersMenu.tsx (2)
packages/desktop-client/src/components/modals/ImportTransactionsModal/utils.ts (1)
  • formatDate (113-124)
packages/loot-core/src/shared/months.ts (1)
  • getMonthYearFormat (452-460)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: build (windows-latest)
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (ubuntu-22.04)
  • GitHub Check: Visual regression (shard 3/5)
  • GitHub Check: Functional (shard 5/5)
  • GitHub Check: Visual regression (shard 1/5)
  • GitHub Check: Visual regression (shard 4/5)
  • GitHub Check: Functional (shard 2/5)
  • GitHub Check: Visual regression (shard 2/5)
  • GitHub Check: Functional (shard 1/5)
  • GitHub Check: Visual regression (shard 5/5)
  • GitHub Check: Functional (shard 3/5)
  • GitHub Check: Functional (shard 4/5)
  • GitHub Check: Functional Desktop App
🔇 Additional comments (4)
upcoming-release-notes/6497.md (1)

1-6: LGTM! Clear and concise release note.

The release note accurately describes the bugfix and follows the standard format.

packages/desktop-client/src/components/filters/FiltersMenu.tsx (3)

45-45: LGTM! Import correctly placed.

The useDateFormat import follows the project's import organization guidelines.


94-94: Good addition of user date format support.

The initialization properly handles the case where useDateFormat() returns null/undefined by providing a sensible fallback. This pattern is consistently used throughout the file (also at lines 339 and 547).


115-128: Excellent implementation of date format conversion.

The logic correctly:

  • Guards against non-month fields and invalid formats with appropriate checks
  • Parses the stored 'yyyy-MM' format and validates the result before formatting
  • Formats the date using the user's configured date format via getMonthYearFormat(dateFormat)
  • Falls back to the original value for edge cases
  • Includes all necessary dependencies in the memoization array

This properly addresses the issue where the month filter edit popup was ignoring the user's configured date format.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

Bundle Stats

desktop-client

Total

Files count Total bundle size % Changed
27 14.15 MB → 14.18 MB (+30.93 kB) +0.21%
Changeset
File Δ Size
locale/es.json 📈 +27 kB (+29.26%) 92.28 kB → 119.28 kB
locale/fr.json 📈 +2.19 kB (+1.24%) 176.19 kB → 178.38 kB
src/components/filters/FiltersMenu.tsx 📈 +159 B (+0.92%) 16.94 kB → 17.1 kB
locale/de.json 📈 +1.51 kB (+0.87%) 172.71 kB → 174.22 kB
locale/en.json 📈 +78 B (+0.05%) 156.57 kB → 156.65 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/es.js 92.28 kB → 119.28 kB (+27 kB) +29.26%
static/js/fr.js 176.19 kB → 178.38 kB (+2.19 kB) +1.24%
static/js/de.js 172.71 kB → 174.22 kB (+1.51 kB) +0.87%
static/js/index.js 9.1 MB → 9.1 MB (+159 B) +0.00%
static/js/en.js 156.57 kB → 156.65 kB (+78 B) +0.05%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 12.94 kB 0%
static/js/workbox-window.prod.es5.js 5.64 kB 0%
static/js/da.js 107.54 kB 0%
static/js/en-GB.js 7.24 kB 0%
static/js/it.js 168.23 kB 0%
static/js/nb-NO.js 160.68 kB 0%
static/js/nl.js 100.11 kB 0%
static/js/pl.js 89.15 kB 0%
static/js/pt-BR.js 148.57 kB 0%
static/js/ru.js 108.29 kB 0%
static/js/th.js 183.36 kB 0%
static/js/uk.js 220.2 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 120.48 kB 0%
static/js/ReportRouter.js 1.09 MB 0%
static/js/narrow.js 639.15 kB 0%
static/js/TransactionList.js 101.33 kB 0%
static/js/wide.js 158.91 kB 0%
static/js/AppliedFilters.js 9.62 kB 0%
static/js/usePayeeRuleCounts.js 11.79 kB 0%
static/js/useTransactionBatchActions.js 12.98 kB 0%
static/js/FormulaEditor.js 1.04 MB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.79 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.DnwHpIfp.js 5.79 MB 0%

api

Total

Files count Total bundle size % Changed
1 4.33 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
bundle.api.js 4.33 MB 0%

Copy link
Copy Markdown
Member

@joel-jeremy joel-jeremy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@youngcw youngcw added this pull request to the merge queue Jan 6, 2026
Merged via the queue into actualbudget:master with commit 5f1c13e Jan 6, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Date format interfering with filters

3 participants