AnsweredAssumed Answered

FeatureLayer setDefinitionExpression & Internet Explorer

Question asked by evtguy on Sep 28, 2015
Latest reply on Mar 14, 2016 by evtguy

This strikes me as odd but I guess it really shouldn't since this is Internet Explorer..

 

Anyways, I have a simple page that loads two feature layers that have two date fields (a beginning and ending date for events). When I add the layers to my map, I attempt to apply a defintion expression based on those date fields:

 

var today = new Date();
var theDefExp = "endDate > date '" + today.toLocaleDateString() + "'";
theLayer.setDefinitionExpression(theDefExp);

 

This works fine in Chrome and Firefox but, under Internet Explorer 11 (and using any "previous" document modes), this throws 400 errors when it actually attempts to display features. In the ArcGIS Server logs, here's the real error:

 

An invalid where clause or definition expression has been requested: "endDate > date '9/28/2015'"

So why does this cause heartburn for IE but not Chrome/Firefox? More importantly, what do I need to change to make it IE friendly?

 

Thanks!

Steve

Outcomes