Hello,
I'm in a bit of an tricky situation where a layer with automatic refreshes in one of our ArcGIS JavaScript apps has been configured to have an incorrect, static time extent in its timeinfo - with us being unable to make changes to said layer currently. This has led our time slider to have the wrong time extent info in our ArcGIS JavaScript 4.27 app.
A quick fix I came up with was to overwrite the time extent when setting up the timeslider, which has fixed the time extent issue temporarily - see here:
//create time slider for layer
const timeSlider = new TimeSlider({
container: "timeSlider",
view: view,
timeVisible: true, // show the time stamps on the timeslider
loop: true,
fullTimeExtent: { // entire extent of the timeSlider
start: new Date(2003, 5, 19),
end: new Date(2024, 5, 16)
},
});
view.whenLayerView(layer).then((lv) => {timeSlider.fullTimeExtent.expandTo("weeks");
timeSlider.stops = {interval: layer.timeInfo.interval};
});
view.ui.add(timeSlider, "bottom-left");
However, I would like to have a way to automatically get the most recent date from the feature layer's time field 'DATE_CREATED' and have this set to be the 'end' value in TimeSlider()'s 'fullTimeExtent.'
Does anybody know if this is possible?
Thank you.