diff --git a/src/app/misc/items-utils.ts b/src/app/misc/items-utils.ts index d98c0497..bb59a432 100644 --- a/src/app/misc/items-utils.ts +++ b/src/app/misc/items-utils.ts @@ -1,6 +1,7 @@ import {ItemType, LibraryItem} from "../../models/resources/library-item"; import {Show, ShowRole} from "../../models/resources/show"; import {Collection} from "../../models/resources/collection"; +import {People} from "../../models/resources/people"; export class ItemsUtils { @@ -12,7 +13,7 @@ export class ItemsUtils return "/show/" + item.slug; } - static getDate(item: LibraryItem | Show | ShowRole | Collection): string + static getDate(item: LibraryItem | Show | ShowRole | Collection | People): string { if ("role" in item && item.role) { @@ -23,6 +24,8 @@ export class ItemsUtils if ("type" in item && item.type && typeof item.type == "string") return item.type; + if (!("startYear" in item)) + return ""; if (item.endYear && item.startYear != item.endYear) return `${item.startYear} - ${item.endYear}` return item.startYear?.toString(); diff --git a/src/app/pages/collection/collection.component.ts b/src/app/pages/collection/collection.component.ts index a99a7cac..57344e47 100644 --- a/src/app/pages/collection/collection.component.ts +++ b/src/app/pages/collection/collection.component.ts @@ -32,7 +32,7 @@ export class CollectionComponent return this.sanitizer.bypassSecurityTrustStyle("url(" + this.collection.poster + ")"); } - getDate(item: LibraryItem | Show | ShowRole | Collection) + getDate(item: LibraryItem | Show | ShowRole | Collection | People) { return ItemsUtils.getDate(item); } diff --git a/src/app/pages/show-details/show-details.component.html b/src/app/pages/show-details/show-details.component.html index 25d96cd0..012ef135 100644 --- a/src/app/pages/show-details/show-details.component.html +++ b/src/app/pages/show-details/show-details.component.html @@ -78,7 +78,7 @@
Season - + {{season.title}}