From 986496786a3c6547a915ed475abf8949415a52f6 Mon Sep 17 00:00:00 2001 From: mcdamo Date: Thu, 28 Apr 2022 17:44:38 +1000 Subject: [PATCH] Use UTC for displaying image timestamps Fixes #469 --- .../infopanel/info-panel.lightbox.gallery.component.html | 4 ++-- .../infopanel/info-panel.lightbox.gallery.component.ts | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/frontend/app/ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html b/src/frontend/app/ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html index cfed7771..f91ca356 100644 --- a/src/frontend/app/ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html +++ b/src/frontend/app/ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html @@ -28,10 +28,10 @@
- {{ media.metadata.creationDate | date: (isThisYear() ? 'MMMM d' : 'longDate')}} + {{ media.metadata.creationDate | date: (isThisYear() ? 'MMMM d' : 'longDate') : 'UTC' }}
-
{{ media.metadata.creationDate | date :'EEEE'}}, {{getTime()}}
+
{{ media.metadata.creationDate | date : 'EEEE, HH:mm:ss' : 'UTC' }}
diff --git a/src/frontend/app/ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.ts b/src/frontend/app/ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.ts index 66b268fd..4acf4112 100644 --- a/src/frontend/app/ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.ts +++ b/src/frontend/app/ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.ts @@ -150,15 +150,10 @@ export class InfoPanelLightboxComponent implements OnInit, OnChanges { isThisYear(): boolean { return ( new Date().getFullYear() === - new Date(this.media.metadata.creationDate).getFullYear() + new Date(this.media.metadata.creationDate).getUTCFullYear() ); } - getTime(): string { - const date = new Date(this.media.metadata.creationDate); - return date.toTimeString().split(' ')[0]; - } - toFraction(f: number): string | number { if (f > 1) { return f;