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