require(["esri/TimeInterval"], function(TimeInterval) { /* code goes here */ });
Class: esri/TimeInterval
Inheritance: TimeInterval JSONSupport
Since: ArcGIS API for JavaScript 4.12
beta

TimeInterval is a class that describes a length of time in one of ten temporal units such as seconds, days, or years. TimeInterval is referenced by many classes, such as TimeInfo, which is referenced by time-aware layers and the TimeSlider widget.

See also:

Constructors

new TimeInterval(properties)
Parameter:
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
NameTypeSummaryClass
String

Temporal units.

more details
more detailsTimeInterval
Number

The numerical value of the time extent.

more details
more detailsTimeInterval

Property Details

unit String

Temporal units.

Possible Values:"milliseconds"|"seconds"|"minutes"|"hours"|"days"|"weeks"|"months"|"years"|"decades"|"centuries"

Default Value:milliseconds
Example:
const featureLayer = new FeatureLayer({
  url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Earthquakes_Since1970/MapServer/0"
});
featureLayer.load().then(function(){
  const interval = featureLayer.timeInfo.interval;
  console.log("The layer's time interval is ", interval.value, interval.unit);
});
value Number

The numerical value of the time extent.

Default Value:0
Example:
const featureLayer = new FeatureLayer({
  url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Earthquakes_Since1970/MapServer/0"
});
featureLayer.load().then(function(){
  const interval = featureLayer.timeInfo.interval;
  console.log("The layer's time interval is ", interval.value, " ", interval.unit);
});

Method Overview

NameReturn TypeSummaryClass
TimeInterval

Creates a deep clone of TimeInterval object.

more details
more detailsTimeInterval

Method Details

clone(){TimeInterval}

Creates a deep clone of TimeInterval object.

Returns:
TypeDescription
TimeIntervalA new instance of a TimeInfo object equal to the object used to call .clone().

API Reference search results

NameTypeModule
Loading...