-
-
-
-
-
-
+
+
+
{{formatDate(now | async)}}
-
-
-
-
-
-
+
+
{{formatTime(now | async)}}
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts
index 0df59aa..78784b4 100644
--- a/src/app/dashboard/dashboard.component.ts
+++ b/src/app/dashboard/dashboard.component.ts
@@ -10,4 +10,17 @@ export class DashboardComponent {
now = timer(0, 1000).pipe(map(() => new Date()));
constructor() { }
+
+ formatTime(date: Date) {
+ if(!date) return '';
+ let hours = date.getHours();
+ let minutes = date.getMinutes();
+ if(hours > 12) hours -= 12;
+ return `${hours < 10 ? `0${hours}` : hours}:${minutes < 10 ? `0${minutes}` : minutes}`
+ }
+
+ formatDate(date: Date) {
+ if(!date) return '';
+ return `${date.toDateString().substr(4, 3)} ${date.getDate()}`;
+ }
}
diff --git a/src/app/weather/widget/weatherWidget.component.html b/src/app/weather/widget/weatherWidget.component.html
index 5614741..f806f32 100644
--- a/src/app/weather/widget/weatherWidget.component.html
+++ b/src/app/weather/widget/weatherWidget.component.html
@@ -1,9 +1,6 @@
+
{{weatherService.weather?.currently.summary}}
-
-
London, ON
- {{weatherService.weather?.currently.summary}}
-