I need help coding an indicator box to show some times. I would like it to look something like:
I can get each part of the code to return, but not as a whole. Below is what I have so far, but it's only returning the Start Time
var poles = FeatureSetByPortalItem(p, 'f2180d9e68b3466ab042399a38aea2fd', 0);
var startTime = Min(poles, 'NewTime');
var endTime = Max(poles, 'NewTime');
var TimeElasped = DateDiff(endTime, startTime, 'hours');
var HoursWorked = Round(TimeElasped, 2);
return HoursWorked
var jsonDictionarySTART = {
fields: [{
alias: "STARTTIME",
name: "STARTTIME",
type: "esriFieldTypeDate",
},],
spatialReference: { wkid: 4326 },
geometryType: "esriGeometryPoint",
features: [{
geometry: {
spatialReference: { wkid: 4326 },
x: -151.0063,
y: 63.069,
},
attributes: {
startTime,
},
}]
};
return FeatureSet(Text(jsonDictionarySTART, 'h:mm:ss'));
var jsonDictionaryEND = {
fields: [{
alias: "ENDTIME",
name: "ENDTIME",
type: "esriFieldTypeDate",
},],
spatialReference: { wkid: 4326 },
geometryType: "esriGeometryPoint",
features: [{
geometry: {
spatialReference: { wkid: 4326 },
x: -151.0063,
y: 63.069,
},
attributes: {
endTime,
},
}]
};
return FeatureSet(Text(jsonDictionaryEND, 'h:mm:ss'));
var jsonDictionaryTOTAL = {
fields: [{
alias: "TOTAL_TIME",
name: "TOTAL_TIME",
type: "esriFieldTypeDouble",
},],
spatialReference: { wkid: 4326 },
geometryType: "esriGeometryPoint",
features: [{
geometry: {
spatialReference: { wkid: 4326 },
x: -151.0063,
y: 63.069,
},
attributes: {
TimeElasped: HoursWorked,
},
}]
};
return FeatureSet(Text(jsonDictionaryTOTAL));