Styling
This commit is contained in:
parent
7ea9b4ed57
commit
0046270ebb
@ -5,7 +5,7 @@
|
|||||||
<h1 class="mb-0">{{formatDate(now | async)}}</h1>
|
<h1 class="mb-0">{{formatDate(now | async)}}</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="pl-2">
|
<div class="pl-2">
|
||||||
<h1 class="mb-0">{{formatTime(now | async)}}</h1>
|
<h1 class="mb-0">{{now | async | date: 'shortTime'}}</h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<mat-card class="mt-3 w-100 hover" routerLink="/battery">
|
<mat-card class="mt-3 w-100 hover" routerLink="/battery">
|
||||||
|
@ -11,14 +11,6 @@ export class DashboardComponent {
|
|||||||
|
|
||||||
constructor() { }
|
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) {
|
formatDate(date: Date) {
|
||||||
if(!date) return '';
|
if(!date) return '';
|
||||||
return `${date.toDateString().substr(4, 3)} ${date.getDate()}`;
|
return `${date.toDateString().substr(4, 3)} ${date.getDate()}`;
|
||||||
|
Loading…
Reference in New Issue
Block a user