feat: add search to Transactions tab, spanning all history

Lets the user find a past purchase by keyword instead of paging through
months manually — search hits description/merchant/notes and ignores the
month filter, with a "jump to month" action on each result to view it in
its normal monthly context.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
ZProger
2026-08-20 23:00:44 +03:00
parent b9ff3ab404
commit 2b2e01a8e2
8 changed files with 182 additions and 23 deletions

View File

@@ -30,9 +30,15 @@ export function getMonthLabels(language: Language): readonly string[] {
return language === "ru" ? MONTH_LABELS_RU : MONTH_LABELS_EN;
}
export function formatTransactionDate(isoDate: string): string {
/** `includeYear` is for contexts spanning multiple years (e.g. an all-time
* search) where "Aug 16" alone wouldn't say which year. */
export function formatTransactionDate(isoDate: string, includeYear = false): string {
const date = new Date(`${isoDate}T00:00:00`);
return new Intl.DateTimeFormat(getIntlLocale(), { month: "short", day: "numeric" }).format(date);
return new Intl.DateTimeFormat(getIntlLocale(), {
month: "short",
day: "numeric",
year: includeYear ? "numeric" : undefined,
}).format(date);
}
/** Russian noun pluralization: pick the right form for 1/2-4/5+ (with the