<?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: Code to change field date size if equal to today in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/code-to-change-field-date-size-if-equal-to-today/m-p/1092700#M5001</link>
    <description>&lt;P&gt;Where exactly are you trying to implement this? Depending on what widget you're working with, this may be doable, but the means of accomplishing it may differ. In an &lt;STRONG&gt;Indicator&lt;/STRONG&gt;, for example, this is pretty easy.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Aug 2021 14:39:30 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2021-08-26T14:39:30Z</dc:date>
    <item>
      <title>Code to change field date size if equal to today</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/code-to-change-field-date-size-if-equal-to-today/m-p/1092688#M5000</link>
      <description>&lt;P&gt;In the details box, How might I code something so that if the date equals {today} that the text would change size? thank you&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 14:30:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/code-to-change-field-date-size-if-equal-to-today/m-p/1092688#M5000</guid>
      <dc:creator>JoeLivoti</dc:creator>
      <dc:date>2021-08-26T14:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Code to change field date size if equal to today</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/code-to-change-field-date-size-if-equal-to-today/m-p/1092700#M5001</link>
      <description>&lt;P&gt;Where exactly are you trying to implement this? Depending on what widget you're working with, this may be doable, but the means of accomplishing it may differ. In an &lt;STRONG&gt;Indicator&lt;/STRONG&gt;, for example, this is pretty easy.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 14:39:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/code-to-change-field-date-size-if-equal-to-today/m-p/1092700#M5001</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-08-26T14:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Code to change field date size if equal to today</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/code-to-change-field-date-size-if-equal-to-today/m-p/1092704#M5002</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoeLivoti_0-1629988866506.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/21794iD635C426D2EA4010/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JoeLivoti_0-1629988866506.png" alt="JoeLivoti_0-1629988866506.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;in this details box. as you can see they are currently ordered by date with newest on top. I'd like to make the next bigger if the date = today's date so as to draw attention to it.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 14:42:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/code-to-change-field-date-size-if-equal-to-today/m-p/1092704#M5002</guid>
      <dc:creator>JoeLivoti</dc:creator>
      <dc:date>2021-08-26T14:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Code to change field date size if equal to today</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/code-to-change-field-date-size-if-equal-to-today/m-p/1092717#M5004</link>
      <description>&lt;P&gt;Should be simple enough in a list, too. You just need a quick expression to evaluate the date field against today's date, then push a value into a returned attribute.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var the_date = $datapoint["sale_date"]

var text_size = "10px"

if(the_date &amp;gt;= today()){
    text_size = "16px"
}

return {
  attributes: {
    text_size: text_size
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once you have this, the next step is to edit your list viewing the HTML source, then using that returned attribute to define a span of text.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;p&amp;gt;{document_number}&amp;lt;/p&amp;gt;
&amp;lt;p style="font-size:{expression/text_size}"&amp;gt;{sale_date}&amp;lt;/p&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My sample data doesn't have any current data, so I've set mine to an arbitrary date so you can see it working.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1629990437684.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/21796i6065838B0E302995/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1629990437684.png" alt="jcarlson_0-1629990437684.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 15:08:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/code-to-change-field-date-size-if-equal-to-today/m-p/1092717#M5004</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-08-26T15:08:10Z</dc:date>
    </item>
  </channel>
</rss>

