Hi,
allready some time ago I noticed that arcade wouldn't allow me to keep my exisiting date data after casting it into a dictionary. It was not possible to simply define the corresponding field in the dictionary as esriFieldTypeDate and then send my exisiting dates into that dictionary by using a for-loop.
As an example that didn't produce the desired results, but kept at least the existing date data:
var dict = {
fields: [
{ name: 'start_time', type: 'esriFieldTypeString' },
{ name: 'BP2_compost_adoption_yn', type: 'esriFieldTypeString' },
],
geometryType: '',
features: [],
};
var index = 0;
for (var feature in fv) {
dict.features[index] = {
'attributes': {
'start_time': Text(feature['start_time']),
'BP2_compost_adoption_yn': Text(feature['BP2_compost_adoption_yn'])
}}
index++;}
Casting the date data into a string had the crucial disadvantage of not being able to filter that data in the dashboards anymore.
Unfortunatly the arcade documentation about dates didn't tell how to cast dates into UNIX epoch time, which is shown as one input for the date function, and seems to be the neccessary input for the esriFieldTypeDate in a dictionary.