mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
validated the last ocurrence date
This commit is contained in:
@@ -134,6 +134,7 @@
|
|||||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||||
placeholder="Choose a date"
|
placeholder="Choose a date"
|
||||||
[(ngModel)]="postEvent.StartDate"
|
[(ngModel)]="postEvent.StartDate"
|
||||||
|
[min]="currentDate"
|
||||||
[max]="maxDate"
|
[max]="maxDate"
|
||||||
[disabled]="disabled"
|
[disabled]="disabled"
|
||||||
>
|
>
|
||||||
@@ -162,6 +163,7 @@
|
|||||||
<input matInput [ngxMatDatetimePicker]="fim"
|
<input matInput [ngxMatDatetimePicker]="fim"
|
||||||
placeholder="Choose a date"
|
placeholder="Choose a date"
|
||||||
[(ngModel)]="postEvent.EndDate"
|
[(ngModel)]="postEvent.EndDate"
|
||||||
|
[min]="currentDate"
|
||||||
[max]="maxDate"
|
[max]="maxDate"
|
||||||
[disabled]="disabled"
|
[disabled]="disabled"
|
||||||
>
|
>
|
||||||
@@ -213,6 +215,7 @@
|
|||||||
placeholder="Choose a date"
|
placeholder="Choose a date"
|
||||||
[(ngModel)]="postEvent.EventRecurrence.LastOccurrence"
|
[(ngModel)]="postEvent.EventRecurrence.LastOccurrence"
|
||||||
[disabled]="disabled"
|
[disabled]="disabled"
|
||||||
|
[min]="postEvent.EndDate"
|
||||||
>
|
>
|
||||||
<mat-datepicker-toggle id="last-occurrence" matSuffix [for]="occurrrence"></mat-datepicker-toggle>
|
<mat-datepicker-toggle id="last-occurrence" matSuffix [for]="occurrrence"></mat-datepicker-toggle>
|
||||||
<ngx-mat-datetime-picker #occurrrence
|
<ngx-mat-datetime-picker #occurrrence
|
||||||
|
|||||||
@@ -247,6 +247,9 @@ export class EditEventPage implements OnInit {
|
|||||||
IsRecurring: new FormControl(this.postEvent.IsRecurring, [
|
IsRecurring: new FormControl(this.postEvent.IsRecurring, [
|
||||||
Validators.required
|
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
|
||||||
|
]),
|
||||||
Date: new FormControl(new Date(this.postEvent.StartDate).getTime() <= new Date(this.postEvent.EndDate).getTime()? 'ok': null,[
|
Date: new FormControl(new Date(this.postEvent.StartDate).getTime() <= new Date(this.postEvent.EndDate).getTime()? 'ok': null,[
|
||||||
Validators.required
|
Validators.required
|
||||||
]),
|
]),
|
||||||
|
|||||||
@@ -122,6 +122,7 @@
|
|||||||
placeholder="Choose a date"
|
placeholder="Choose a date"
|
||||||
[(ngModel)]="postEvent.StartDate"
|
[(ngModel)]="postEvent.StartDate"
|
||||||
[disabled]="disabled"
|
[disabled]="disabled"
|
||||||
|
[min]="currentDate"
|
||||||
>
|
>
|
||||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||||
<ngx-mat-datetime-picker #picker1
|
<ngx-mat-datetime-picker #picker1
|
||||||
@@ -153,6 +154,7 @@
|
|||||||
placeholder="Choose a date"
|
placeholder="Choose a date"
|
||||||
[(ngModel)]="postEvent.EndDate"
|
[(ngModel)]="postEvent.EndDate"
|
||||||
[disabled]="disabled"
|
[disabled]="disabled"
|
||||||
|
[min]="currentDate"
|
||||||
>
|
>
|
||||||
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
|
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
|
||||||
<ngx-mat-datetime-picker #fim
|
<ngx-mat-datetime-picker #fim
|
||||||
@@ -202,6 +204,7 @@
|
|||||||
placeholder="Choose a date"
|
placeholder="Choose a date"
|
||||||
[(ngModel)]="postEvent.EventRecurrence.LastOccurrence"
|
[(ngModel)]="postEvent.EventRecurrence.LastOccurrence"
|
||||||
[disabled]="disabled"
|
[disabled]="disabled"
|
||||||
|
[min]="postEvent.EndDate"
|
||||||
>
|
>
|
||||||
<mat-datepicker-toggle id="last-occurrence" matSuffix [for]="occurrrence"></mat-datepicker-toggle>
|
<mat-datepicker-toggle id="last-occurrence" matSuffix [for]="occurrrence"></mat-datepicker-toggle>
|
||||||
<ngx-mat-datetime-picker #occurrrence
|
<ngx-mat-datetime-picker #occurrrence
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ export class NewEventPage implements OnInit {
|
|||||||
public stepMinute = 5;
|
public stepMinute = 5;
|
||||||
public stepSecond = 5;
|
public stepSecond = 5;
|
||||||
public color: ThemePalette = 'primary';
|
public color: ThemePalette = 'primary';
|
||||||
|
currentDate = new Date();
|
||||||
|
|
||||||
Form: FormGroup;
|
Form: FormGroup;
|
||||||
validateFrom = false
|
validateFrom = false
|
||||||
@@ -279,7 +280,7 @@ export class NewEventPage implements OnInit {
|
|||||||
CalendarName: new FormControl(this.postEvent.CalendarName, [
|
CalendarName: new FormControl(this.postEvent.CalendarName, [
|
||||||
Validators.required
|
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
|
Validators.required
|
||||||
]),
|
]),
|
||||||
Categories: new FormControl(this.postEvent.Category, [
|
Categories: new FormControl(this.postEvent.Category, [
|
||||||
@@ -288,6 +289,10 @@ export class NewEventPage implements OnInit {
|
|||||||
participantes: new FormControl(this.taskParticipants, [
|
participantes: new FormControl(this.taskParticipants, [
|
||||||
Validators.required
|
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
|
||||||
|
]),
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,6 +198,7 @@
|
|||||||
placeholder="Choose a date"
|
placeholder="Choose a date"
|
||||||
[(ngModel)]="postEvent.EventRecurrence.LastOccurrence"
|
[(ngModel)]="postEvent.EventRecurrence.LastOccurrence"
|
||||||
[disabled]="disabled"
|
[disabled]="disabled"
|
||||||
|
[min]="postEvent.EndDate"
|
||||||
>
|
>
|
||||||
<mat-datepicker-toggle id="last-occurrence" matSuffix [for]="occurrrence"></mat-datepicker-toggle>
|
<mat-datepicker-toggle id="last-occurrence" matSuffix [for]="occurrrence"></mat-datepicker-toggle>
|
||||||
<ngx-mat-datetime-picker #occurrrence
|
<ngx-mat-datetime-picker #occurrrence
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ export class EditEventPage implements OnInit {
|
|||||||
Categories: new FormControl(this.postEvent.Category, [
|
Categories: new FormControl(this.postEvent.Category, [
|
||||||
Validators.required
|
Validators.required
|
||||||
]),
|
]),
|
||||||
dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type, [
|
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
|
Validators.required
|
||||||
]),
|
]),
|
||||||
participantes: new FormControl(this.taskParticipants, [
|
participantes: new FormControl(this.taskParticipants, [
|
||||||
|
|||||||
@@ -211,6 +211,7 @@
|
|||||||
placeholder="Choose a date"
|
placeholder="Choose a date"
|
||||||
[(ngModel)]="postEvent.EventRecurrence.LastOccurrence"
|
[(ngModel)]="postEvent.EventRecurrence.LastOccurrence"
|
||||||
[disabled]="disabled"
|
[disabled]="disabled"
|
||||||
|
[min]="postEvent.EndDate"
|
||||||
>
|
>
|
||||||
<mat-datepicker-toggle id="last-occurrence" matSuffix [for]="occurrrence"></mat-datepicker-toggle>
|
<mat-datepicker-toggle id="last-occurrence" matSuffix [for]="occurrrence"></mat-datepicker-toggle>
|
||||||
<ngx-mat-datetime-picker #occurrrence
|
<ngx-mat-datetime-picker #occurrrence
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ export class NewEventPage implements OnInit {
|
|||||||
dateEnd: new FormControl(this.postEvent.EndDate, [
|
dateEnd: new FormControl(this.postEvent.EndDate, [
|
||||||
Validators.required
|
Validators.required
|
||||||
]),
|
]),
|
||||||
dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok']: this.postEvent.EventRecurrence.LastOccurrence, [
|
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
|
Validators.required
|
||||||
]),
|
]),
|
||||||
participantes: new FormControl(this.taskParticipants, [
|
participantes: new FormControl(this.taskParticipants, [
|
||||||
|
|||||||
Reference in New Issue
Block a user