<?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 Re: Only show Features on map that are between Start and End Date/Time Fields in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/only-show-features-on-map-that-are-between-start/m-p/1387107#M57700</link>
    <description>&lt;P&gt;Thanks for this. This helps. It kind of led me to a knew issue though. I don't want the Closed events to show on the map. I can change the symbol to be blank, but when I click on a feature that is Open, it could have 4 other features under it that are closed and show up in the popup. So is there anyway to just show the date for the Open events on the map and in the popup?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wish they we could just run arcade expressions in the filter tool.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Feb 2024 23:52:47 GMT</pubDate>
    <dc:creator>JustinNettleton1</dc:creator>
    <dc:date>2024-02-26T23:52:47Z</dc:date>
    <item>
      <title>Only show Features on map that are between Start and End Date/Time Fields</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/only-show-features-on-map-that-are-between-start/m-p/1386989#M57692</link>
      <description>&lt;P&gt;I have web service that is showing road closures that usually last less than a day. I am trying to find a way to only show the closures on the map that are active, so after the start date/time and before the end date/time.&amp;nbsp; I have been trying to accomplish this by&amp;nbsp; using an arcade symbology expression, but I can't figure out. Says the expression is right but doesn't show the closures I want on the map.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this the best way to accomplish this?&amp;nbsp; Does anybody have an idea on how to best set up the expression?&amp;nbsp; &amp;nbsp;I have 3 types of date time fields to choose from, I can't figure out any of them out.&amp;nbsp; &amp;nbsp;I have attached an image of the field options I have.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is one expression I tried with the epoch date fields.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;//ToLocal(Timestamp())&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;started&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;closureStartEpoch&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;closed&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;closureEndEpoch&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;present&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;date&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;// if current date/time is greater than or equal to the start time&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// AND current date/time is less than or equal to the close time &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// return open, otherwise its closed&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;present&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt;= &lt;/SPAN&gt;&lt;SPAN&gt;started&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;&amp;am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t;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;These are the Start and End Date/Time fields I have to choose from.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TimeOptions.jpg" style="width: 969px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/95875i94A356C3E140DB2C/image-size/large?v=v2&amp;amp;px=999" role="button" title="TimeOptions.jpg" alt="TimeOptions.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 26 Feb 2024 19:54:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/only-show-features-on-map-that-are-between-start/m-p/1386989#M57692</guid>
      <dc:creator>JustinNettleton1</dc:creator>
      <dc:date>2024-02-26T19:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Only show Features on map that are between Start and End Date/Time Fields</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/only-show-features-on-map-that-are-between-start/m-p/1387027#M57695</link>
      <description>&lt;P&gt;You can't directly compare the epoch number to a Date like that. You'll have to convert it to a Date. Arcade can create a Date from an epoch number, it must be in milliseconds (adding "000" to your attributes). For example:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Date(1709269260) = &lt;SPAN class=""&gt;Jan 20, 1970, 1:47:49 PM Eastern Standard Time&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;Date(1709269260000) = &lt;SPAN class=""&gt;Mar 1, 2024, 12:01:00 AM Eastern Standard Time&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN class=""&gt;If you want to use that field, then your expression should look like this &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var started = Date($feature.closureStartEpoch + '000');
var closed = Date($feature.closureEndEpoch + '000');
var present = Date()
If (present &amp;gt;= started &amp;amp;&amp;amp; present &amp;lt;= closed) return "Open"
return "Closed"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2024 20:45:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/only-show-features-on-map-that-are-between-start/m-p/1387027#M57695</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-02-26T20:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Only show Features on map that are between Start and End Date/Time Fields</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/only-show-features-on-map-that-are-between-start/m-p/1387107#M57700</link>
      <description>&lt;P&gt;Thanks for this. This helps. It kind of led me to a knew issue though. I don't want the Closed events to show on the map. I can change the symbol to be blank, but when I click on a feature that is Open, it could have 4 other features under it that are closed and show up in the popup. So is there anyway to just show the date for the Open events on the map and in the popup?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wish they we could just run arcade expressions in the filter tool.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2024 23:52:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/only-show-features-on-map-that-are-between-start/m-p/1387107#M57700</guid>
      <dc:creator>JustinNettleton1</dc:creator>
      <dc:date>2024-02-26T23:52:47Z</dc:date>
    </item>
  </channel>
</rss>

