HOW TO
In an ArcGIS Pro page layout, a dynamic date range string can be used to provide context or information about the temporal extent of the data being presented. This is useful for time-aware layers or time series data.
This article describes the workflow to create a dynamic date range string in a layout in ArcGIS Pro using ArcGIS Arcade.
Note: A map frame must be created before adding a layout. Refer to ArcGIS Pro: Add and modify map frames for more information.
Note: • To determine the date before the current date, specify a negative number for ''. • To determine the date after the current date, specify a positive number for ''.
var relDate = Now();
var start = DateAdd(relDate, <numberOfDays>, "days");
var end = DateAdd(relDate, <numberOfDays>, "days");
Text(start, 'M/D/Y') + ' to ' + Text(end, 'M/D/Y');
The following code block shows the full working script.
var relDate = Now();
var start = DateAdd(relDate, -8, "days");
var end = DateAdd(relDate, -2, "days");
Text(start, 'M/D/Y') + ' to ' + Text(end, 'M/D/Y');
The map below shows the dynamic date range string is displayed.
Article ID: 000031729
Get help from ArcGIS experts
Download the Esri Support App