Fix dates
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit

This commit is contained in:
Willem Dantuma 2020-07-07 09:37:17 +02:00
parent 1092d5dcaf
commit cecbdb2ded

View File

@ -35,7 +35,7 @@ export class SelectedItemTemporalComponent extends AbstractSelectedItemComponent
nextDate():Date { nextDate():Date {
let temporalItemLayer = this.itemLayer as ITemporalItemLayer; let temporalItemLayer = this.itemLayer as ITemporalItemLayer;
if(temporalItemLayer.nextItemLayer.item) if(temporalItemLayer.nextItemLayer.item)
return temporalItemLayer.nextItemLayer.item.dataDate; return new Date(Date.parse(temporalItemLayer.nextItemLayer.item.dataDate)) ;
return null; return null;
} }
@ -47,7 +47,7 @@ export class SelectedItemTemporalComponent extends AbstractSelectedItemComponent
previousDate():Date { previousDate():Date {
let temporalItemLayer = this.itemLayer as ITemporalItemLayer; let temporalItemLayer = this.itemLayer as ITemporalItemLayer;
if(temporalItemLayer.previousItemLayer.item) if(temporalItemLayer.previousItemLayer.item)
return temporalItemLayer.previousItemLayer.item.dataDate; return new Date(Date.parse(temporalItemLayer.previousItemLayer.item.dataDate));
return null; return null;
} }
@ -74,7 +74,7 @@ export class SelectedItemTemporalComponent extends AbstractSelectedItemComponent
} }
handleGoToChart(item: IItem) { 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; return false;
} }
} }