Solving a bug

This commit is contained in:
Zoe Roux 2020-08-07 00:46:48 +02:00
parent d5336180e6
commit 4d2174287d
2 changed files with 9 additions and 3 deletions

View File

@ -5,8 +5,7 @@
</div>
<div class="col-md-8 col-lg-9 col-xl-10">
<h3 class="text-center text-md-left p-2 p-md-3">{{collection.name}}</h3>
<h5 class="date" *ngIf="collection.endYear; else elseBlock">{{collection.startYear}} - {{collection.endYear}}</h5>
<ng-template #elseBlock><h5 class="date">{{collection.startYear}}</h5></ng-template>
<h5 class="date">{{getDate(collection)}}</h5>
<hr />
<app-items-grid [page]="shows"></app-items-grid>
</div>

View File

@ -2,9 +2,11 @@ import {Component} from '@angular/core';
import {Collection} from "../../../models/resources/collection";
import {ActivatedRoute} from "@angular/router";
import {DomSanitizer} from "@angular/platform-browser";
import {Show} from "../../../models/resources/show";
import {Show, ShowRole} from "../../../models/resources/show";
import {Page} from "../../../models/page";
import {People} from "../../../models/resources/people";
import {LibraryItem} from "../../../models/resources/library-item";
import {ItemsUtils} from "../../misc/items-utils";
@Component({
selector: 'app-collection',
@ -29,4 +31,9 @@ export class CollectionComponent
{
return this.sanitizer.bypassSecurityTrustStyle("url(" + this.collection.poster + ")");
}
getDate(item: LibraryItem | Show | ShowRole | Collection)
{
return ItemsUtils.getDate(item);
}
}