fix: synchronize calendar month input and add month navigation

This commit is contained in:
2026-09-06 14:08:08 +03:00
parent 6c33012ab8
commit 525b673e25
5 changed files with 30 additions and 3 deletions
+9
View File
@@ -79,3 +79,12 @@ test('calendar agenda sorts known times before unknown and preserves undated rec
assert.equal([...agenda.days.values()].flat().length+agenda.undated.length,records.length);
assert.equal(records[0].id,'late');
});
test('calendar month navigation crosses year boundaries without invalid months',async()=>{
const {shiftCalendarMonth}=await import('../src/services/tenderCalendar.js');
assert.equal(shiftCalendarMonth('2026-12',1),'2027-01');
assert.equal(shiftCalendarMonth('2026-01',-1),'2025-12');
assert.equal(shiftCalendarMonth('2024-02',1),'2024-03');
assert.equal(shiftCalendarMonth('9999-12',1),null);
assert.equal(shiftCalendarMonth('0001-01',-1),null);
assert.equal(shiftCalendarMonth('2026-13',1),null);
});