Skip to content

Commit d8c3cad

Browse files
committed
fix repeat every month error
1 parent b6766bf commit d8c3cad

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

packages/loot-core/src/server/budget/template-notes.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ describe('unparse/parse round-trip', () => {
324324
'#template 200 repeat every 2 months starting 2025-06-01',
325325
'#template 300 repeat every week starting 2025-01-07',
326326
'#template 400 repeat every year starting 2025-01-01 up to 50',
327+
'#template 100 repeat every 1 months starting 2026-04-01',
327328
// by / spend
328329
'#template 500 by 2025-12',
329330
'#template 600 by 2025-11 repeat every month',

packages/loot-core/src/server/budget/template-notes.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,7 @@ function periodToString(p: {
300300
period: 'day' | 'week' | 'month' | 'year';
301301
amount: number;
302302
}): string {
303-
const { period, amount } = p;
304-
if (amount === 1) {
305-
return period; // singular
306-
}
307-
// pluralize simple
308-
return `${amount} ${period}s`;
303+
return `${p.amount} ${p.period}s`;
309304
}
310305

311306
function repeatToString(annual?: boolean, repeat?: number): string | null {

0 commit comments

Comments
 (0)