<?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 Arcade expression for closed on government holidays in ArcGIS Online Developers Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-for-closed-on-government/m-p/1627859#M1588</link>
    <description>&lt;P&gt;I have a two fields that deal with the operating hours of cooling centers. The &lt;EM&gt;HOURS&lt;/EM&gt; field has text that displays in a pop-up in AGOL. The &lt;EM&gt;HoursDays&lt;/EM&gt; field converts the hours to the 24hr clock and those values are used in the Arcade expression to style the features in the webmap. The feature styles show either "Open now" or "Closed" based on the 24hr values.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JaredPilbeam2_0-1751041412036.png" style="width: 823px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/135295i88CE606D1251D80B/image-dimensions/823x35?v=v2" width="823" height="35" role="button" title="JaredPilbeam2_0-1751041412036.png" alt="JaredPilbeam2_0-1751041412036.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// convert to 24 hour time
function ConvertTime(input) {
  var theTime = input;
  if (Find(":", theTime) &amp;gt; -1) {
    var times = split(theTime, ":");
    theTime = Number(times[0]) + Number(times[1]) / 60;
  }
  return Number(theTime);
}
var current = ConvertTime(Time(Now()));
var fTime = $feature.HoursDays;
var times = Split(fTime, ',')
var todaysTime = times[Weekday(Today()) - 1];
if (todaysTime == 'closed') return 'Closed'

var todaysTimes = Split(todaysTime, '-')
var start = ConvertTime(todaysTimes[0]);
var end = ConvertTime(todaysTimes[1]);

iif(current &amp;gt;= start &amp;amp;&amp;amp; current &amp;lt;= end, 'Open now', 'Closed')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm missing is a way to use Arcade to create a "Closed" style for government holidays, namely:&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;January 1st, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;January 20th, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;February 17th, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;May 26th, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;June 19th, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;July 4th, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;September 1st, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;October 13th, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;November 11th, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;November 27th, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;December 25th, 2025&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jun 2025 16:43:27 GMT</pubDate>
    <dc:creator>JaredPilbeam2</dc:creator>
    <dc:date>2025-06-27T16:43:27Z</dc:date>
    <item>
      <title>Arcade expression for closed on government holidays</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-for-closed-on-government/m-p/1627859#M1588</link>
      <description>&lt;P&gt;I have a two fields that deal with the operating hours of cooling centers. The &lt;EM&gt;HOURS&lt;/EM&gt; field has text that displays in a pop-up in AGOL. The &lt;EM&gt;HoursDays&lt;/EM&gt; field converts the hours to the 24hr clock and those values are used in the Arcade expression to style the features in the webmap. The feature styles show either "Open now" or "Closed" based on the 24hr values.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JaredPilbeam2_0-1751041412036.png" style="width: 823px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/135295i88CE606D1251D80B/image-dimensions/823x35?v=v2" width="823" height="35" role="button" title="JaredPilbeam2_0-1751041412036.png" alt="JaredPilbeam2_0-1751041412036.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// convert to 24 hour time
function ConvertTime(input) {
  var theTime = input;
  if (Find(":", theTime) &amp;gt; -1) {
    var times = split(theTime, ":");
    theTime = Number(times[0]) + Number(times[1]) / 60;
  }
  return Number(theTime);
}
var current = ConvertTime(Time(Now()));
var fTime = $feature.HoursDays;
var times = Split(fTime, ',')
var todaysTime = times[Weekday(Today()) - 1];
if (todaysTime == 'closed') return 'Closed'

var todaysTimes = Split(todaysTime, '-')
var start = ConvertTime(todaysTimes[0]);
var end = ConvertTime(todaysTimes[1]);

iif(current &amp;gt;= start &amp;amp;&amp;amp; current &amp;lt;= end, 'Open now', 'Closed')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm missing is a way to use Arcade to create a "Closed" style for government holidays, namely:&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;January 1st, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;January 20th, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;February 17th, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;May 26th, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;June 19th, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;July 4th, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;September 1st, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;October 13th, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;November 11th, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;November 27th, 2025&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;December 25th, 2025&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jun 2025 16:43:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-for-closed-on-government/m-p/1627859#M1588</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2025-06-27T16:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression for closed on government holidays</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-for-closed-on-government/m-p/1627871#M1589</link>
      <description>&lt;P&gt;You could create an array of DateOnly holidays and test whether today as a DateOnly is in that array&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var holidays = [
  DateOnly(2025, 0, 1), //Months are 0-based
  DateOnly(2025, 0, 20),
  DateOnly(2025, 1, 17),
  etc...
];
if (Includes(holidays, DateOnly())) {
  return "Closed (Federal holiday)";
} else {
  iif(current &amp;gt;= start &amp;amp;&amp;amp; current &amp;lt;= end, "Open now", "Closed");
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jun 2025 17:06:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-for-closed-on-government/m-p/1627871#M1589</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-06-27T17:06:42Z</dc:date>
    </item>
  </channel>
</rss>

