A date selector just needs a date field to act against, so you should just be able to include a date field in the expression. Define the date field in your combinedDict object, then pull the date field in from the feature in your loop later.
If this is on Portal, you'll need to use Number to get your date to come through correctly.
var combinedDict = {
"fields": [
{'name': 'WATERSHED','type':'esriFieldTypeString'},
{'name': 'GROUP_NAME','type':'esriFieldTypeString'},
{'name': 'Weights','type':'esriFieldTypeInteger'},
{'name': 'some_date', type: 'esriFieldTypeDate'}
],
"geometryType": "",
"features": []
}
var i = 0
for (var f in fs) {
combinedDict.features[i++] = {
"attributes": {
"WATERSHED": f["WATERSHED"],
"GROUP_NAME": f["GROUP_NAME"],
"Weights": f["FIELD_1"] * 25 + f["FIELD_2"] * 22 + f["FIELD_3"] * f["FIELD_4"],
some_date: Number(f['some_date'])
}
}
var result = FeatureSet(Text(combinedDict))
return result
Once your featureset has a date field in it, any date selector should be able to act against it.
- Josh Carlson
Kendall County GIS