Validate weekly playtime as a whole number in staff application form.
This commit is contained in:
parent
300d33da7d
commit
894dfac0c6
|
|
@ -173,6 +173,8 @@
|
|||
Weekly playtime is required
|
||||
} @else if (form.controls.weeklyPlaytime.errors?.['min']) {
|
||||
Weekly playtime must be at least 1 hour
|
||||
} @else if (form.controls.weeklyPlaytime.errors?.['pattern']) {
|
||||
Please enter a whole number of hours (e.g., 20)
|
||||
}
|
||||
</mat-error>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ export class StaffApplicationComponent implements OnInit, OnDestroy, AfterViewIn
|
|||
}),
|
||||
weeklyPlaytime: new FormControl('', {
|
||||
nonNullable: true,
|
||||
validators: [Validators.required, Validators.min(1)]
|
||||
validators: [Validators.required, Validators.min(1), Validators.pattern('^[0-9]*$')]
|
||||
}),
|
||||
availableDays: new FormControl([], {
|
||||
nonNullable: true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user