So after asking Robert Scheitlin, GISP about some custom URL parameters I've been able to tweak some code modifications he sent to extrapolate upon them. But I'm hitting a weird error. Here is my code:
//now check if there is a url search to do
var myObject = this.getUrlParams();
if (myObject.esearch) {
if(myObject.esearch === "curmonth"){
var today = new Date();
today.setDate(1);
var thisMonthStr = this._formatDate(today.getTime(), 'yyyy/MM/dd');
myObject.esearch = thisMonthStr + "~" + this._formatDate(new Date().getTime(), 'yyyy/MM/dd');
console.info(myObject.esearch);
}
if(myObject.esearch === "curyear"){
var today = new Date();
today.setDate(1);
var thisYearStr = this._formatDate(today.getTime(), 'yyyy');
console.info("This year string is : " + thisYearStr);
myObject.esearch = this._formatDate(new Date(thisYearStr), 'yyyy');
console.info("This year string AFTER modiication is : " + myObject.esearch);
}
if(this.config.layers[myObject.slayer].expressions.expression.length > 0){
var valuesObj1 = lang.clone(this.config.layers[myObject.slayer].expressions.expression[myObject.exprnum].values.value);
var values = myObject.esearch.split("|");
array.forEach(values, lang.hitch(this, function(val, index){
if (val.indexOf('~') > -1){
var ranges =