diff --git a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html index 3214adf1d..957ff060b 100644 --- a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html +++ b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html @@ -111,6 +111,7 @@ placeholder="Choose a date" [(ngModel)]="startDate" [disabled]="disabled" + [min]="currentDate" > 1){ - this.selectedRecurringType = ev.filter(data => data != '-1'); + this.postEvent.EventRecurrence.Type = ev.filter(data => data != '-1'); } if(ev.length == 0){ - this.selectedRecurringType = "-1"; - } */ + this.postEvent.EventRecurrence.Type = "-1"; + } + } + + calculetedLastOccurrence(type:number){ + var valor; + var opcao: boolean; + if (type == 0) { + valor = 7; + opcao = true; + } else if(type == 1){ + valor = 30; + opcao = true; + } else if(type == 2){ + valor = 1; + opcao = false; + }else if(type == 3){ + valor = 5; + opcao = false; + } + this.defineLastOccurrence(valor, opcao); + } + + + defineLastOccurrence(valor:number, opcao:boolean){ + var time = new Date(this.endDate); + if (opcao == true) { + time.setDate(time.getDate() + valor); + this.eventProcess.workflowInstanceDataFields.LastOccurrence = time; + } else { + time = new Date( + time.getFullYear() + valor, + time.getMonth(), + time.getDate(), + time.getHours(), + time.getMinutes() + ); + this.eventProcess.workflowInstanceDataFields.LastOccurrence = time; + } + } openLastOccurrence() {