AnsweredAssumed Answered

feature setDefiniition expression for a date

Question asked by louchios on Apr 24, 2014
Latest reply on Apr 24, 2014 by louchios
Hi I am trying to set up my def expression to display only points within the last 90 days using a feature service from the NWS.

However, no points are being displayed when I know some points should be. If I change the def expression to another field ("injuries > 3"); that works. I am not sure if the date field is formatted correctly and I could not find any examples. Thank you!

stormdate ( type: esriFieldTypeDate , alias: stormdate , editable: true , nullable: true , length: 36 )

var feature = new esri.layers.FeatureLayer(layer.url, {    infoTemplate: infoTemplate,           mode: esri.layers.FeatureLayer.MODE_ONDEMAND,    outFields: ["stormdate", "surveydate", "injuries"]    });     var pastDate = new Date();    pastDate.setDate(pastDate.getDate()-90);                          feature.setDefinitionExpression("stormdate >  pastDate");

Outcomes