fix: resolve course/class fields, surname i18n, optional nationalId, auto class end date, login styling, and mobile sidebar navigation

This commit is contained in:
2026-08-21 15:03:28 +03:30
parent b1c3dd6218
commit 86f1f9bab0
13 changed files with 348 additions and 117 deletions
+10 -1
View File
@@ -1,6 +1,6 @@
import { describe, it } from 'node:test';
import assert from 'node:assert/strict';
import { formatClassDays, formatClassTime, formatClassSchedule } from './classSchedule.js';
import { formatClassDays, formatClassTime, formatClassSchedule, calculateClassEndDate } from './classSchedule.js';
describe('class schedule display', () => {
it('formats weekdays in Iran week order', () => {
@@ -19,4 +19,13 @@ describe('class schedule display', () => {
);
assert.equal(formatClassSchedule({}), '');
});
it('calculates class end date from start date, days and number of sessions', () => {
// 1403/01/01 is Wednesday (day 3)
// If days are [6, 2] (Saturday, Tuesday), 2 sessions:
// Session 1: Saturday 1403/01/04
// Session 2: Tuesday 1403/01/07
const endDate = calculateClassEndDate('1403/01/01', [6, 2], 2);
assert.equal(endDate, '1403/01/07');
});
});