AMD:
require(["esri/support/timeUtils"], (timeUtils) => { /* code goes here */ });
ESM:
import * as timeUtils from "@arcgis/core/support/timeUtils.js";
Object:
esri/support/timeUtils
Since: ArcGIS Maps SDK for JavaScript 4.21
Provides utility methods for working with dates.
Method Overview
Name | Return Type | Summary | Object |
---|---|---|---|
Promise<TimeExtent> | Returns the time extent of all layers. more details | timeUtils |
Method Details
-
getTimeExtentFromLayers(layers, signal){Promise<TimeExtent>}
-
Returns the time extent of all layers.
Parameterslayers Layer[]|Collection<Layer>An array or collection of layers to compute a time extent from.
signal AbortSignaloptionalAbortSignal allows for cancelable requests. If canceled, the promise will be rejected with an error named
AbortError
. See also AbortController.ReturnsType Description Promise<TimeExtent> Returns a promise that resolves to a TimeExtent. Examples// Get the time extent of all layers in the view. const fullTimeExtent = await getTimeExtentFromLayers(view.map.allLayers);
// Get the time extent from an array of layers. const timeExtent = await getTimeExtentFromLayers([ earthquakes, emergencyCalls ]);