validated the last ocurrence date

This commit is contained in:
EQUILIBRIUM\hirondino.van-dunem
2022-07-06 09:12:57 +01:00
parent a25eea749e
commit 3a3ba605dd
8 changed files with 19 additions and 3 deletions
@@ -50,6 +50,7 @@ export class NewEventPage implements OnInit {
public stepMinute = 5;
public stepSecond = 5;
public color: ThemePalette = 'primary';
currentDate = new Date();
Form: FormGroup;
validateFrom = false
@@ -279,7 +280,7 @@ export class NewEventPage implements OnInit {
CalendarName: new FormControl(this.postEvent.CalendarName, [
Validators.required
]),
Date: new FormControl(this.dateValid, [
Date: new FormControl(new Date(this.postEvent.StartDate).getTime() <= new Date(this.postEvent.EndDate).getTime()? 'ok': null,[
Validators.required
]),
Categories: new FormControl(this.postEvent.Category, [
@@ -288,6 +289,10 @@ export class NewEventPage implements OnInit {
participantes: new FormControl(this.taskParticipants, [
Validators.required
]),
dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok']: this.postEvent.EventRecurrence.LastOccurrence && new Date(this.postEvent.EventRecurrence.LastOccurrence).getTime() > new Date(this.postEvent.EndDate).getTime() ? 'ok': null, [
Validators.required
]),
})
}