mirror of
https://github.com/Zproger/Aurum.git
synced 2026-10-13 11:06:40 +07:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user