diff --git a/frontend/package.json b/frontend/package.json index 8c61b993..9595d765 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -38,6 +38,7 @@ "ng2-charts": "^2.3.0", "ngx-dropzone": "^3.1.0", "ngx-highlightjs": "^7.0.1", + "ngx-moment": "^6.0.2", "observable-webworker": "^4.0.1", "pouchdb": "^7.3.0", "pouchdb-authentication": "^1.1.3", diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts index 472d8161..e8e86f52 100644 --- a/frontend/src/app/app.module.ts +++ b/frontend/src/app/app.module.ts @@ -24,6 +24,7 @@ import {Router} from '@angular/router'; import { SourceDetailComponent } from './pages/source-detail/source-detail.component'; import { HighlightModule, HIGHLIGHT_OPTIONS } from 'ngx-highlightjs'; import {AuthInterceptorService} from './services/auth-interceptor.service'; +import { MomentModule } from 'ngx-moment'; @NgModule({ declarations: [ @@ -47,7 +48,8 @@ import {AuthInterceptorService} from './services/auth-interceptor.service'; NgbModule, ChartsModule, NgxDropzoneModule, - HighlightModule + HighlightModule, + MomentModule ], providers: [ { diff --git a/frontend/src/app/pages/dashboard/dashboard.component.html b/frontend/src/app/pages/dashboard/dashboard.component.html index 289a684f..128b71d1 100644 --- a/frontend/src/app/pages/dashboard/dashboard.component.html +++ b/frontend/src/app/pages/dashboard/dashboard.component.html @@ -155,8 +155,8 @@

status:
{{isActive(source)}}

-

last updated:
{{source.updated_at | date}}

-

expires:
{{source.expires_at}}

+

last updated:
{{source.updated_at | amTimeAgo}}

+

expires:
{{source.expires_at | amFromUnix | amTimeAgo}}

diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 6f11a9e2..1dff64a3 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -5850,6 +5850,13 @@ ngx-highlightjs@^7.0.1: highlightjs-line-numbers.js "^2.8.0" tslib "^2.0.0" +ngx-moment@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/ngx-moment/-/ngx-moment-6.0.2.tgz#7acba9830746e9c2862d261150f2c8adb20eb4f6" + integrity sha512-HUvDyoJPZKLA3tc+GMQqDpVyCVT2SPfEiV7/CGj2Dwwsn//JhhQ8eTr+RzKqBzLysrXkCwlzulVVJaJ5A0FJEA== + dependencies: + tslib "^2.3.0" + nice-napi@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/nice-napi/-/nice-napi-1.0.2.tgz#dc0ab5a1eac20ce548802fc5686eaa6bc654927b"