From 7ceb019b00f0f47f2d4cf80105cba84ef678d9d1 Mon Sep 17 00:00:00 2001 From: Mario Basa Date: Wed, 22 Apr 2015 17:26:39 +0900 Subject: [PATCH] check if dates are empty --- WebContent/jsp/showtheme.jsp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/WebContent/jsp/showtheme.jsp b/WebContent/jsp/showtheme.jsp index 8afbe01..c738f11 100644 --- a/WebContent/jsp/showtheme.jsp +++ b/WebContent/jsp/showtheme.jsp @@ -291,8 +291,8 @@ var sTypes = Ext.get('types' ).dom.value; var sColors = Ext.get('colors' ).dom.value; var sRanges = Ext.get('ranges' ).dom.value; - var sFromDate = Ext.get('fromDateId').dom.value; - var sToDate = Ext.get('toDateId' ).dom.value; + var sFromDate; + var sToDate; var sBaseLayer= map.baseLayer.id; @@ -303,9 +303,16 @@ url = url.concat("&ranges=").concat(sRanges); url = url.concat("&colors=").concat(sColors); url = url.concat("&baselayer=").concat(sBaseLayer); - url = url.concat("&fromDate=").concat(sFromDate); - url = url.concat("&toDate=").concat(sToDate); + + if( Ext.get('fromDateId') != null && Ext.get('toDateId') != null ) { + sFromDate = Ext.get('fromDateId').dom.value; + sToDate = Ext.get('toDateId' ).dom.value; + + url = url.concat("&fromDate=").concat(sFromDate); + url = url.concat("&toDate=").concat(sToDate); + } + showShareWin( url ); }