fix(sms): prefix course time with ساعت

SMS courseTime now reads «از ساعت 19 تا 21» instead of «از 19 تا 21».
This commit is contained in:
2026-08-16 00:16:40 +03:30
parent 4d60755a95
commit a6c760c3b7
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ const formatCourseTime = (startTime, endTime) => {
const end = formatClockPart(endTime); const end = formatClockPart(endTime);
if (!start) return ''; if (!start) return '';
if (!end) return start; if (!end) return start;
return `از ${start} تا ${end}`; return `از ساعت ${start} تا ${end}`;
}; };
const weekdayIndex = (value) => { const weekdayIndex = (value) => {
+5 -5
View File
@@ -14,8 +14,8 @@ const {
describe('class schedule SMS helpers', () => { describe('class schedule SMS helpers', () => {
it('formats course time as an hour range', () => { it('formats course time as an hour range', () => {
assert.equal(formatCourseTime('19:00', '21:00'), 'از 19 تا 21'); assert.equal(formatCourseTime('19:00', '21:00'), 'از ساعت 19 تا 21');
assert.equal(formatCourseTime('19:30', '21:00'), 'از 19:30 تا 21'); assert.equal(formatCourseTime('19:30', '21:00'), 'از ساعت 19:30 تا 21');
}); });
it('joins class weekdays in Persian week order', () => { it('joins class weekdays in Persian week order', () => {
@@ -47,7 +47,7 @@ describe('class schedule SMS helpers', () => {
assert.ok(context.classStartDate); assert.ok(context.classStartDate);
assert.equal(context.classDays, 'شنبه و دوشنبه'); assert.equal(context.classDays, 'شنبه و دوشنبه');
assert.equal(context.courseTime, 'از 19 تا 21'); assert.equal(context.courseTime, 'از ساعت 19 تا 21');
}); });
it('uses the current session for course time when provided', () => { it('uses the current session for course time when provided', () => {
@@ -57,7 +57,7 @@ describe('class schedule SMS helpers', () => {
{ startTime: '10:00', endTime: '12:00' } { startTime: '10:00', endTime: '12:00' }
); );
assert.equal(context.courseTime, 'از 10 تا 12'); assert.equal(context.courseTime, 'از ساعت 10 تا 12');
}); });
it('prefers stored class days and times over inferred sessions', () => { it('prefers stored class days and times over inferred sessions', () => {
@@ -75,7 +75,7 @@ describe('class schedule SMS helpers', () => {
); );
assert.equal(context.classDays, 'شنبه و دوشنبه'); assert.equal(context.classDays, 'شنبه و دوشنبه');
assert.equal(context.courseTime, 'از 18 تا 20'); assert.equal(context.courseTime, 'از ساعت 18 تا 20');
}); });
}); });