Skip to content

Commit

Permalink
fix: NoSunday date validator does not work properly (#1459)
Browse files Browse the repository at this point in the history
Update special-validators.ts for sunday, it's not working due to wrong check.
  • Loading branch information
kp7860 authored Jul 10, 2023
1 parent 31028be commit 623921d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/shared/forms/validators/special-validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,6 @@ export class SpecialValidators {
private static noDay(control: FormControl, day: 'saturday' | 'sunday'): boolean {
const date = control.value as Date;

return !(day === 'saturday' ? date?.getDay() === 6 : date?.getDate() === 0);
return !(day === 'saturday' ? date?.getDay() === 6 : date?.getDay() === 0);
}
}

0 comments on commit 623921d

Please sign in to comment.