Merge branch 'max_dev' of Software_Engineering_I/greenvironment-frontend into master

master
Trivernis 5 years ago committed by Gitea
commit 7be490e4b8

@ -8,8 +8,11 @@
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker disabled="false"></mat-datepicker>
</mat-form-field>
<mat-form-field style="display:contents;">
<input matInput #time type="time" placeholder="choose a time">
</mat-form-field>
</div>
<div mat-dialog-actions>
<button mat-button (click)="onNoClick()">Cancel</button>
<button mat-button cdkFocusInitial (click)="createEvent(name.value, date.value)">Create Event</button>
<button mat-button cdkFocusInitial (click)="createEvent(name.value, date.value, time.value)">Create Event</button>
</div>

@ -28,11 +28,14 @@ export class DialogCreateEventComponent {
this.dialogRef.close();
}
createEvent(name: string, date: string) {
createEvent(name: string, date: string, time: string) {
name = name.trim();
if (name && date) {
this.group.createEvent(name, (new Date(date)).getTime().toString(), this.groupId);
this.dialogRef.close();
if (name && date && time) {
date = date + ' ' + time;
console.log(date);
console.log(new Date(date).getTime().toString());
this.group.createEvent(name, (new Date(date)).getTime().toString(), this.groupId);
this.dialogRef.close();
}
}

Loading…
Cancel
Save