mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Fix
This commit is contained in:
@@ -66,18 +66,10 @@ export class EditEventPage implements OnInit {
|
||||
@Output() setIntervenientCC = new EventEmitter<any>();
|
||||
@Output() clearPostEvent = new EventEmitter<any>();
|
||||
|
||||
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
|
||||
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
|
||||
|
||||
showLoader = false
|
||||
|
||||
get dateStart () {
|
||||
return this.dateControlStart.value
|
||||
}
|
||||
|
||||
get dateEnd () {
|
||||
return this.dateControlEnd.value
|
||||
}
|
||||
|
||||
@ViewChild('picker') picker: any;
|
||||
@ViewChild('fim') fim: any;
|
||||
@@ -146,9 +138,7 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
this.getAttachments(this.postEvent.EventId);
|
||||
|
||||
this.restoreDatepickerData();
|
||||
this.getRecurrenceTypes();
|
||||
|
||||
this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString();
|
||||
@@ -200,19 +190,13 @@ export class EditEventPage implements OnInit {
|
||||
Categories: new FormControl(this.postEvent.Category, [
|
||||
Validators.required
|
||||
]),
|
||||
dateStart: new FormControl(this.dateStart, [
|
||||
Validators.required
|
||||
]),
|
||||
dateEnd: new FormControl(this.dateEnd, [
|
||||
Validators.required
|
||||
]),
|
||||
dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type, [
|
||||
Validators.required
|
||||
]),
|
||||
participantes: new FormControl(this.taskParticipants, [
|
||||
// Validators.required
|
||||
]),
|
||||
Date: new FormControl( new Date(this.dateControlStart.value).toLocaleString('pt') < new Date(this.dateControlEnd.value).toLocaleString('pt')? 'ok': null,[
|
||||
Date: new FormControl( new Date(this.postEvent.StartDate).toLocaleString('pt') < new Date(this.postEvent.EndDate).toLocaleString('pt')? 'ok': null,[
|
||||
Validators.required
|
||||
]),
|
||||
|
||||
@@ -262,7 +246,6 @@ export class EditEventPage implements OnInit {
|
||||
return false
|
||||
}
|
||||
|
||||
this.getDatepickerData()
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
|
||||
if(!this.postEvent.EventRecurrence.hasOwnProperty('Type')) {
|
||||
@@ -358,24 +341,10 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
getDatepickerData() {
|
||||
if (this.postEvent) {
|
||||
this.postEvent.StartDate = this.dateStart
|
||||
this.postEvent.EndDate = this.dateEnd
|
||||
}
|
||||
}
|
||||
|
||||
restoreDatepickerData() {
|
||||
if (this.postEvent) {
|
||||
this.dateControlStart = new FormControl(moment(this.postEvent.StartDate));
|
||||
this.dateControlEnd = new FormControl(moment(this.postEvent.EndDate));
|
||||
}
|
||||
}
|
||||
|
||||
saveTemporaryData() {
|
||||
|
||||
this.getDatepickerData()
|
||||
|
||||
window['temp.path:/home/agenda/edit-event.component.ts'] = {
|
||||
postEvent: this.postEvent,
|
||||
eventBody: this.eventBody,
|
||||
@@ -392,8 +361,6 @@ export class EditEventPage implements OnInit {
|
||||
this.eventBody = restoredData.eventBody
|
||||
this.segment = restoredData.segment
|
||||
|
||||
this.restoreDatepickerData()
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user