From cecbdb2ded4ecc68580b15328035c68fd100bd04 Mon Sep 17 00:00:00 2001 From: Willem Dantuma Date: Tue, 7 Jul 2020 09:37:17 +0200 Subject: [PATCH] Fix dates --- .../selected-item-temporal.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/common-map/src/fm-map/components/selected-item-temporal/selected-item-temporal.component.ts b/projects/common-map/src/fm-map/components/selected-item-temporal/selected-item-temporal.component.ts index d7d0fe5..ba52853 100644 --- a/projects/common-map/src/fm-map/components/selected-item-temporal/selected-item-temporal.component.ts +++ b/projects/common-map/src/fm-map/components/selected-item-temporal/selected-item-temporal.component.ts @@ -35,7 +35,7 @@ export class SelectedItemTemporalComponent extends AbstractSelectedItemComponent nextDate():Date { let temporalItemLayer = this.itemLayer as ITemporalItemLayer; if(temporalItemLayer.nextItemLayer.item) - return temporalItemLayer.nextItemLayer.item.dataDate; + return new Date(Date.parse(temporalItemLayer.nextItemLayer.item.dataDate)) ; return null; } @@ -47,7 +47,7 @@ export class SelectedItemTemporalComponent extends AbstractSelectedItemComponent previousDate():Date { let temporalItemLayer = this.itemLayer as ITemporalItemLayer; if(temporalItemLayer.previousItemLayer.item) - return temporalItemLayer.previousItemLayer.item.dataDate; + return new Date(Date.parse(temporalItemLayer.previousItemLayer.item.dataDate)); return null; } @@ -74,7 +74,7 @@ export class SelectedItemTemporalComponent extends AbstractSelectedItemComponent } handleGoToChart(item: IItem) { - this.router.navigate(['/viewer', 'temporal', 'item', item.parentCode, item.dataDate.getUTCFullYear()]); + this.router.navigate(['/viewer', 'temporal', 'item', item.parentCode, new Date(Date.parse(item.dataDate)).getUTCFullYear()]); return false; } }