#16: Setting end date automatically if end date is before start
All checks were successful
Jenkins Production Deployment

This commit is contained in:
Patrick Müller 2023-05-16 20:30:23 +02:00
parent 0861294534
commit ab9c579765
Signed by: Paddy
GPG Key ID: 37ABC11275CAABCE

View File

@ -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() {