TimeInterval
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 Objectoptional
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.
Name | Type | Summary | Class | |
---|---|---|---|---|
String | Temporal units. more details | more details | TimeInterval | |
Number | The numerical value of the time extent. more details | more details | TimeInterval |
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
Name | Return Type | Summary | Class | |
---|---|---|---|---|
TimeInterval | Creates a deep clone of TimeInterval object. more details | more details | TimeInterval |
Method Details
- clone(){TimeInterval}
Creates a deep clone of TimeInterval object.
Returns:Type Description TimeInterval A new instance of a TimeInfo object equal to the object used to call .clone()
.
Loading...