From ad04096f15c825a9d8369bc0db56f76d47680520 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 12 Jan 2020 22:39:21 +0100 Subject: [PATCH] added time picker for events --- src/app/components/group/dialog.html | 5 ++++- src/app/components/group/group.component.ts | 11 +++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/app/components/group/dialog.html b/src/app/components/group/dialog.html index 80b4cff..719cdd4 100644 --- a/src/app/components/group/dialog.html +++ b/src/app/components/group/dialog.html @@ -8,8 +8,11 @@ + + +
- +
diff --git a/src/app/components/group/group.component.ts b/src/app/components/group/group.component.ts index 2b2e5b3..6e5af39 100644 --- a/src/app/components/group/group.component.ts +++ b/src/app/components/group/group.component.ts @@ -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(); } }