Skip to content

Commit

Permalink
CSCEXAM-1204 Disallow adding examination events if period overdue
Browse files Browse the repository at this point in the history
  • Loading branch information
lupari committed Jul 3, 2024
1 parent 1a2d70a commit 335ff16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@
</sup>
</div>
<div class="col-md-3">
<button type="button" (click)="addExaminationEvent()" class="btn btn-success">
<button
type="button"
(click)="addExaminationEvent()"
[disabled]="isPeriodOver()"
class="btn btn-success"
>
{{ 'i18n_add_examination_event' | translate }}
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ export class ExamPublicationComponent implements OnInit {
}
};

isPeriodOver = () => new Date(this.exam.periodEnd as string) < new Date();

addExaminationEvent = () => {
const modalRef = this.modal.open(ExaminationEventDialogComponent, {
backdrop: 'static',
Expand Down

0 comments on commit 335ff16

Please sign in to comment.