mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
Merge pull request #480 from mcdamo/bug/date-timezone
Use UTC for displaying image timestamps
This commit is contained in:
commit
55558a07ab
@ -28,10 +28,10 @@
|
||||
</div>
|
||||
<div class="col-10">
|
||||
<div class="details-main">
|
||||
{{ media.metadata.creationDate | date: (isThisYear() ? 'MMMM d' : 'longDate')}}
|
||||
{{ media.metadata.creationDate | date: (isThisYear() ? 'MMMM d' : 'longDate') : 'UTC' }}
|
||||
</div>
|
||||
<div class="details-sub row">
|
||||
<div class="col-12">{{ media.metadata.creationDate | date :'EEEE'}}, {{getTime()}}</div>
|
||||
<div class="col-12">{{ media.metadata.creationDate | date : 'EEEE, HH:mm:ss' : 'UTC' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user