#6: Add ability to create whole-day events
All checks were successful
Jenkins Production Deployment

This commit is contained in:
Patrick Müller 2022-12-28 12:33:20 +01:00
parent effb0efb6d
commit aa0d03c86a
Signed by: Paddy
GPG Key ID: 37ABC11275CAABCE
4 changed files with 12 additions and 5 deletions

View File

@ -8,13 +8,16 @@
<td> <td>
<input type="text" [(ngModel)]="event!.description"> <input type="text" [(ngModel)]="event!.description">
</td> </td>
<td>
<input type="checkbox" [(ngModel)]="event!.wholeDay">
</td>
<td class="{{showDateError || requiredFieldsMissing? 'has-error' : ''}}"> <td class="{{showDateError || requiredFieldsMissing? 'has-error' : ''}}">
<input type="date" [(ngModel)]="newStartDate" (change)="setStartDateTime()"> <input type="date" [(ngModel)]="newStartDate" (change)="setStartDateTime()">
<input type="time" [(ngModel)]="newStartTime" (change)="setStartDateTime()"> <input type="time" [(ngModel)]="newStartTime" (change)="setStartDateTime()" *ngIf="!this.event!.wholeDay">
</td> </td>
<td class="{{showDateError || requiredFieldsMissing? 'has-error' : ''}}"> <td class="{{showDateError || requiredFieldsMissing? 'has-error' : ''}}">
<input type="date" [(ngModel)]="newEndDate" (change)="setEndDateTime()"> <input type="date" [(ngModel)]="newEndDate" (change)="setEndDateTime()">
<input type="time" [(ngModel)]="newEndTime" (change)="setEndDateTime()"> <input type="time" [(ngModel)]="newEndTime" (change)="setEndDateTime()" *ngIf="!this.event!.wholeDay">
</td> </td>
<td> <td>
<input type="text" [(ngModel)]="event!.location"> <input type="text" [(ngModel)]="event!.location">
@ -45,13 +48,16 @@
<td> <td>
{{event?.description}} {{event?.description}}
</td> </td>
<td>
<input type="checkbox" [(ngModel)]="event!.wholeDay" disabled>
</td>
<td> <td>
<input type="date" [value]="newStartDate" readonly> <input type="date" [value]="newStartDate" readonly>
<input type="time" [value]="newStartTime" readonly> <input type="time" [value]="newStartTime" readonly *ngIf="!this.event!.wholeDay">
</td> </td>
<td> <td>
<input type="date" [value]="newEndDate" readonly> <input type="date" [value]="newEndDate" readonly>
<input type="time" [value]="newEndTime" readonly> <input type="time" [value]="newEndTime" readonly *ngIf="!this.event!.wholeDay">
</td> </td>
<td> <td>
{{event?.location}} {{event?.location}}

View File

@ -63,7 +63,6 @@ export class EventComponent implements OnInit {
this.showCreateError = true; this.showCreateError = true;
return; return;
} }
}); });
} else { } else {
// Update existing event // Update existing event

View File

@ -3,6 +3,7 @@
<th>Calendar</th> <th>Calendar</th>
<th>Name</th> <th>Name</th>
<th>Description</th> <th>Description</th>
<th>Whole Day</th>
<th>Start</th> <th>Start</th>
<th>End</th> <th>End</th>
<th>Location</th> <th>Location</th>

View File

@ -10,4 +10,5 @@ export interface Event {
location: string; location: string;
createdBy: string; createdBy: string;
url: string; url: string;
wholeDay: boolean;
} }