Add checks
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma 2021-01-29 12:42:19 +01:00
parent eb50218a8d
commit 208dfed7fb

View File

@ -14,9 +14,9 @@ export class TemporalService {
}
selectedDate(itemLayer:IItemLayer):string {
let temporalItemLayer = itemLayer as ITemporalItemLayer;
if(temporalItemLayer.selectedItemLayer) {
if(temporalItemLayer.selectedItemLayer.item.dataDate && temporalItemLayer.selectedItemLayer.item.dataEndDate) {
let temporalItemLayer = itemLayer as ITemporalItemLayer;
if(temporalItemLayer && temporalItemLayer.selectedItemLayer) {
if(temporalItemLayer && temporalItemLayer.selectedItemLayer.item.dataDate && temporalItemLayer.selectedItemLayer.item.dataEndDate) {
let sd = new Date(Date.parse(temporalItemLayer.selectedItemLayer.item.dataDate));
let ed = new Date(Date.parse(temporalItemLayer.selectedItemLayer.item.dataEndDate));
return this.timespanService$.getCaption(sd,ed);
@ -30,7 +30,7 @@ export class TemporalService {
nextDate(itemLayer:IItemLayer):string {
let temporalItemLayer = itemLayer as ITemporalItemLayer;
if(temporalItemLayer.nextItemLayer.item) {
if(temporalItemLayer && temporalItemLayer.nextItemLayer && temporalItemLayer.nextItemLayer.item) {
if(temporalItemLayer.nextItemLayer.item.dataDate && temporalItemLayer.nextItemLayer.item.dataEndDate) {
let sd = new Date(Date.parse(temporalItemLayer.nextItemLayer.item.dataDate));
let ed = new Date(Date.parse(temporalItemLayer.nextItemLayer.item.dataEndDate));
@ -50,7 +50,7 @@ export class TemporalService {
previousDate(itemLayer:IItemLayer):string {
let temporalItemLayer = itemLayer as ITemporalItemLayer;
if(temporalItemLayer.previousItemLayer.item) {
if(temporalItemLayer && temporalItemLayer.previousItemLayer && temporalItemLayer.previousItemLayer.item) {
if(temporalItemLayer.previousItemLayer.item.dataDate && temporalItemLayer.previousItemLayer.item.dataEndDate) {
let sd = new Date(Date.parse(temporalItemLayer.previousItemLayer.item.dataDate));
let ed = new Date(Date.parse(temporalItemLayer.previousItemLayer.item.dataEndDate));