core: fix tsdoc endAt error (#1060)

This commit is contained in:
BlackPanda authored and GitHub committed 2025-10-05 13:55:53 +01:00
1 parent f06aa69862
commit 8f2c5a17cd
1 file changed
+2 -1
+2 -1
View File
@@ -94,7 +94,8 @@ export class ContestDetailBaseHandler extends Handler {
}
}
if (this.tdoc.duration && this.tsdoc?.startAt) {
this.tsdoc.endAt = moment(this.tsdoc.startAt).add(this.tdoc.duration, 'hours').toDate();
const endAt = moment(this.tsdoc.startAt).add(this.tdoc.duration, 'hours').toDate();
this.tsdoc.endAt = endAt < this.tdoc.endAt ? endAt : this.tdoc.endAt;
}
}