<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Date Range Domain End Date of Current Date in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/date-range-domain-end-date-of-current-date/m-p/1641567#M98154</link>
    <description>&lt;P&gt;Good morning. I'm pretty sure the answer to this is 'no, good idea, go put it in the idea section'.&lt;/P&gt;&lt;P&gt;I would like to have a Range Domain on a date field that has a maximum value of the present. So today the maximum value is 8/13/2025, tomorrow the maximum value is automatically adjusted to 8/14/2025. I'm not too concerned about the time component, but for arguments sake I should be able to set it as local or utc time.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use case is an additional check to make sure that the data wasn't fat fingered in wrong. Of course I could check it in a variety of other ways, but this seems to be a fairly straight forward approach to validation that a date isn't in the future.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;George&lt;/P&gt;</description>
    <pubDate>Wed, 13 Aug 2025 15:01:02 GMT</pubDate>
    <dc:creator>GeorgeNewbury</dc:creator>
    <dc:date>2025-08-13T15:01:02Z</dc:date>
    <item>
      <title>Date Range Domain End Date of Current Date</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/date-range-domain-end-date-of-current-date/m-p/1641567#M98154</link>
      <description>&lt;P&gt;Good morning. I'm pretty sure the answer to this is 'no, good idea, go put it in the idea section'.&lt;/P&gt;&lt;P&gt;I would like to have a Range Domain on a date field that has a maximum value of the present. So today the maximum value is 8/13/2025, tomorrow the maximum value is automatically adjusted to 8/14/2025. I'm not too concerned about the time component, but for arguments sake I should be able to set it as local or utc time.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use case is an additional check to make sure that the data wasn't fat fingered in wrong. Of course I could check it in a variety of other ways, but this seems to be a fairly straight forward approach to validation that a date isn't in the future.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;George&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2025 15:01:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/date-range-domain-end-date-of-current-date/m-p/1641567#M98154</guid>
      <dc:creator>GeorgeNewbury</dc:creator>
      <dc:date>2025-08-13T15:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: Date Range Domain End Date of Current Date</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/date-range-domain-end-date-of-current-date/m-p/1641611#M98161</link>
      <description>&lt;P&gt;"No, good idea, go put it in the idea section."&lt;BR /&gt;&lt;BR /&gt;In all seriousness, ArcGIS Pro does not support dynamic domains natively so some type of scripting would be required for this type of functionality.&amp;nbsp; I wonder if an attribute rule of some sort would work?&lt;BR /&gt;&lt;BR /&gt;Update:&amp;nbsp; I created an immediate calculation rule for inserts and updates to the feature class where the date calculation is based upon another fields attribute value of 'Active' vs 'Inactive'.&amp;nbsp; The arcade expression would be something like this:&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;if ($feature.Status == 'Active') {&lt;BR /&gt;return Now();&lt;BR /&gt;} else {&lt;BR /&gt;return Null;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;So if you add a new feature it calculates today's date - same if you move the feature.&amp;nbsp; I also had to use default attribute values in the feature template where Status is set to Active for the insert trigger to work.&amp;nbsp; Would this work?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2025 17:06:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/date-range-domain-end-date-of-current-date/m-p/1641611#M98161</guid>
      <dc:creator>Robert_LeClair</dc:creator>
      <dc:date>2025-08-13T17:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: Date Range Domain End Date of Current Date</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/date-range-domain-end-date-of-current-date/m-p/1641661#M98166</link>
      <description>&lt;P&gt;I like to use "Calculation" style attribute rules as constraints and/or validators (rather than using either of those specifically named flavors of Attribute Rules, but your opinions may vary).&lt;/P&gt;&lt;P&gt;Here is a "Date" field called "A_Date" where I've entered a date in the past, today's date, left a NULL value, and then finally entered a date in the future (8/15/2025 at the time of writing this). This rule accepts the first three, and fails with a specific error message when a future date is entered.&lt;/P&gt;&lt;P&gt;This is sort of hack together "dynamic" domain, which seems like what you want. Using similar logic, I think you could also set something up where you only allow "yesterday," "today," or "tomorrow," that sort of dynamic date range scenario.&lt;/P&gt;&lt;P&gt;I believe there are time zone options available in Arcade too, if you want to go down that road.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// My date field.
var enteredDate = $feature.A_Date

// Get current date using built-in function.
var curDate = Now()

// If entered date is in the future, block it from being entered. Return message to user.
if (enteredDate &amp;gt; curDate) {
    return {
        "errorMessage": "This value is in the future, and therefore invalid."
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="invalid_date.png" style="width: 746px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/138465i6CF569CF719D7EF4/image-size/large?v=v2&amp;amp;px=999" role="button" title="invalid_date.png" alt="invalid_date.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2025 18:10:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/date-range-domain-end-date-of-current-date/m-p/1641661#M98166</guid>
      <dc:creator>VinceE</dc:creator>
      <dc:date>2025-08-13T18:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Date Range Domain End Date of Current Date</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/date-range-domain-end-date-of-current-date/m-p/1641668#M98167</link>
      <description>&lt;P&gt;Here's a very unnecessarily verbose version of this, but I use this basic template structure a lot for these "constraint" or domain type on-the-fly validation checks. You can incorporate several different checks and error messages, depending on what you're checking.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;/*
SCRIPT SUMMARY:
AUTHOR: 
DATE: 
*/
//---------------------------------------------------------------------//
// INPUTS
var enteredDate = $feature.A_Date

// OUTPUT FIELDS
var dateFldName = "A_Date"

//---------------------------------------------------------------------//
// FUNCTIONS
function dateValidate(dateVal) {
    // Initialize results dictionary
    var result = Dictionary("VALUE", dateVal, "ERROR", null)

    // Null is fine, return value as-is
    if (IsEmpty(dateVal)) {
        return result
    }

    // CHECK 1: if entered date is in the future, return error
    var curDate = Now()
    if (dateVal &amp;gt; curDate) {
        result["ERROR"] = "This date is in the future, and therefore invalid."
        return result
    }

    // Otherwise return value as-is
    return result
}

//---------------------------------------------------------------------//
// MAIN
var fldUpdates = Dictionary()

// Validate using custom function.
var result = dateValidate(enteredDate)

// If error found, return message and block the edit
if (!IsEmpty(result["ERROR"])) {
    var msg =  `\n\n• SUBMITTED VALUE: '${Text(result["VALUE"], "MM/DD/YYYY")}'`
               + `\n\n• ERROR: ${result["ERROR"]}`
               + `\n\n• GENERAL NOTE: Date must be today or earlier.`

    return {"errorMessage": msg}
}
// Else, update field value (in this case, return the value as-is)
else {
    fldUpdates[dateFldName] = result["VALUE"]
}

return {"result": {"attributes": fldUpdates}}&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 13 Aug 2025 18:22:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/date-range-domain-end-date-of-current-date/m-p/1641668#M98167</guid>
      <dc:creator>VinceE</dc:creator>
      <dc:date>2025-08-13T18:22:22Z</dc:date>
    </item>
  </channel>
</rss>

