<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Date validation</title><link>https://community.appian.com/discussions/f/new-to-appian/25416/date-validation</link><description>I know this may sound little trivial but I couldn&amp;#39;t figure out the logic. 
 I want a button should be enabled before 5 calendar days from the last date of the month to the first 3 calendar days of next month. 
 Example from if it&amp;#39;s Aug, then it should</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Date validation</title><link>https://community.appian.com/thread/99023?ContentTypeID=1</link><pubDate>Thu, 04 Aug 2022 15:51:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cc3078c6-cf91-4de8-b15a-65daf42d8b29</guid><dc:creator>thevarunbawa</dc:creator><description>&lt;p&gt;That works perfectly, thanks &lt;a href="/members/csteward"&gt;Chris&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date validation</title><link>https://community.appian.com/thread/98957?ContentTypeID=1</link><pubDate>Thu, 04 Aug 2022 03:15:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cf56818e-58b0-4268-8ae0-bd840550797e</guid><dc:creator>deepakg681722</dc:creator><description>&lt;p&gt;I am so sorry, for disable please try this code.&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  /*your actual date*/
  local!data: today() - 7,
  /*getting last 5th date of the month*/
  local!startDate: eomonth(local!data, 0) - 5,
  /*from the last 5th date adding 8 to go to next month&amp;#39;s 3rd day*/
  local!endDate: local!startDate + 8,
  a!buttonLayout(
    primaryButtons: {
      a!buttonWidget(
        label: &amp;quot;Submit&amp;quot;,
        disabled: not(
          and(
            local!startDate &amp;lt; today(),
            today() &amp;lt; local!endDate
          )
        )
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date validation</title><link>https://community.appian.com/thread/98956?ContentTypeID=1</link><pubDate>Thu, 04 Aug 2022 03:14:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8b9520c2-3764-4c82-b808-1b2ae77bb67f</guid><dc:creator>deepakg681722</dc:creator><description>&lt;p&gt;Hey varun, Could you please the attached code once please&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  /*your actual date*/
  local!data:today()-7,
  /*getting last 5th date of the month*/
  local!startDate: eomonth(local!data,0)-5,
   /*from the last 5th date adding 8 to go to next month&amp;#39;s 3rd day*/
  local!endDate:local!startDate+8,
  
  a!buttonLayout(
    showWhen: and(
      local!startDate&amp;lt;today(),
      today()&amp;lt;local!endDate
    ),
    primaryButtons: {
      a!buttonWidget(
        label:&amp;quot;Submit&amp;quot;
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date validation</title><link>https://community.appian.com/thread/98938?ContentTypeID=1</link><pubDate>Wed, 03 Aug 2022 19:36:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f1ea6122-19e6-4fab-adfd-c7d55a9b33f4</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Try this.&amp;nbsp; Since today is Aug 3, it will be enabled, toggle the commenting on lines 2 and 3 to see how it would act tomorrow (disabled):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;a!localVariables(
  local!date: today(),
  /*local!date: today()+1,*/
  local!daysInMonth: daysinmonth(month(local!date),year(local!date)),
  local!day: day(local!date),
  local!dayDisabledStart: 3,
  local!dayDisabledEnd: local!daysInMonth-5,
  {
    a!buttonArrayLayout(
      align: &amp;quot;START&amp;quot;,
      buttons: {
        a!buttonWidget(
          label: &amp;quot;Button&amp;quot;,
          disabled: not(
            or(
              local!day&amp;lt;=local!dayDisabledStart,
              local!day&amp;gt;=local!dayDisabledEnd,
            )
          )
        )
      }
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>