1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2025-01-06 03:54:12 +02:00

fixing infobox error

This commit is contained in:
Patrik J. Braun 2018-05-28 12:03:52 -04:00
parent 0efd28c10f
commit 86402d229f
2 changed files with 4 additions and 8 deletions

View File

@ -27,12 +27,7 @@
</div>
<div class="col-10">
<div class="details-main">
<ng-container *ngIf="getYear() !== getCurrentYear()">
{{ photo.metadata.creationDate | date :'longDate'}}
</ng-container>
<ng-container *ngIf="getYear() === getCurrentYear()">
{{ photo.metadata.creationDate | date :'MMMM d'}}
</ng-container>
{{ photo.metadata.creationDate | date: (isThisYear() ? 'MMMM d': 'longDate')}}
</div>
<div class="details-sub row">
<div class="col-12">{{ photo.metadata.creationDate | date :'EEEE'}}, {{getTime()}}</div>

View File

@ -31,8 +31,9 @@ export class InfoPanelLightboxComponent {
return size.toFixed(2) + postFixes[index];
}
getCurrentYear() {
return (new Date()).getFullYear();
isThisYear() {
return (new Date()).getFullYear() ===
(new Date(this.photo.metadata.creationDate)).getFullYear();
}