From c647135466aeaf0f979dd3deb822e259f1ac2c32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20Rem=C3=A9nyi?= <gergo@gergo.city> Date: Sat, 19 Jun 2021 20:39:33 +0200 Subject: [PATCH] Make dates prettier --- src/app/app.module.ts | 8 ++++++-- src/app/core/service-detail/service-detail.component.html | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 35169c4..2ac3a49 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,4 +1,4 @@ -import { NgModule } from '@angular/core'; +import { LOCALE_ID, NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; @@ -19,6 +19,9 @@ import { ServiceInListComponent } from './core/service-in-list/service-in-list.c import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { LoaderComponent } from './shared/loader/loader.component'; import { ErrorDialogComponent } from './shared/error-dialog/error-dialog.component'; +import { registerLocaleData } from '@angular/common'; +import localeHu from '@angular/common/locales/hu'; +registerLocaleData(localeHu, 'hu'); @NgModule({ declarations: [ @@ -41,7 +44,8 @@ import { ErrorDialogComponent } from './shared/error-dialog/error-dialog.compone provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true, - } + }, + { provide: LOCALE_ID, useValue: 'hu'} ], bootstrap: [AppComponent], }) diff --git a/src/app/core/service-detail/service-detail.component.html b/src/app/core/service-detail/service-detail.component.html index ee38db6..9d54745 100644 --- a/src/app/core/service-detail/service-detail.component.html +++ b/src/app/core/service-detail/service-detail.component.html @@ -138,7 +138,7 @@ </div> <div class='border-top mt-3 pt-3' *ngFor='let history of service.history; TrackBy: trackById'> <div> - {{history.createdAt | date: "full"}} + {{history.createdAt | date: 'yyyy. MMM dd. hh:mm:ss'}} </div> <div> {{history.description}} -- GitLab