diff --git a/src/app/components/event/event.component.ts b/src/app/components/event/event.component.ts index b75d656..b70213a 100644 --- a/src/app/components/event/event.component.ts +++ b/src/app/components/event/event.component.ts @@ -46,7 +46,6 @@ export class EventComponent implements OnInit { // Check required fields if( this.isNullOrBlank(this.event.name) || - this.isNullOrBlank(this.event.createdBy) || this.event.startDateTime == undefined || this.event.endDateTime == undefined ) { @@ -96,6 +95,14 @@ export class EventComponent implements OnInit { this.event.startDateTime.setMinutes(newTime.getMinutes()); this.event.startDateTime.setSeconds(0); } + + // Set end date accordingly if behind start date + if(this.event) { + if(this.event.endDateTime < this.event.startDateTime) { + this.newEndDate = this.serializeDate(this.event.startDateTime); + this.newEndTime = this.serializeTime(this.event.startDateTime); + } + } } setEndDateTime() {