<?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>validations to check date field within last 12 months</title><link>https://community.appian.com/discussions/f/user-interface/25363/validations-to-check-date-field-within-last-12-months</link><description>when a user inputs the date in date field other than within last 12 months then validation error should popup.. Thanks for your time and help..</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: validations to check date field within last 12 months</title><link>https://community.appian.com/thread/98732?ContentTypeID=1</link><pubDate>Sun, 31 Jul 2022 11:15:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9e909933-9fbd-4b72-a98d-2354b814ca33</guid><dc:creator>Prasad Surendran</dc:creator><description>&lt;p&gt;thank you that helped &lt;a href="/members/scarg"&gt;ogomes&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: validations to check date field within last 12 months</title><link>https://community.appian.com/thread/98698?ContentTypeID=1</link><pubDate>Fri, 29 Jul 2022 10:39:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:97ee6997-de63-477a-89d9-d4d8bc143cdc</guid><dc:creator>ogomes</dc:creator><description>&lt;p&gt;Hi Prasad,&lt;/p&gt;
&lt;p&gt;Try this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!date,
  a!formLayout(
    label: &amp;quot;Example: Date Field Validation Rule&amp;quot;,
    contents:{
      a!dateField(
        label: &amp;quot;Select a valid date&amp;quot;,
        instructions: &amp;quot;Enter a date within last 12 months&amp;quot;,
        value: local!date,
        saveInto: local!date,
        validations: {
          if(
            not(
              and(
                today() - 365 &amp;lt;= todate(local!date),
                local!date &amp;lt;= today()
              )
            ),
            &amp;quot;Date selected is not within last 12 months&amp;quot;,
            &amp;quot;&amp;quot;
          )
        }
      )
    },
    buttons: a!buttonLayout(
      primaryButtons: a!buttonWidget(
        label: &amp;quot;Submit&amp;quot;,
        submit: true
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: validations to check date field within last 12 months</title><link>https://community.appian.com/thread/98692?ContentTypeID=1</link><pubDate>Fri, 29 Jul 2022 08:07:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d2b7a524-eadf-45bb-a162-fc891f85f774</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Validations in general:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/22.2/recipe-add-multiple-validation-rules-to-one-component.html"&gt;https://docs.appian.com/suite/help/22.2/recipe-add-multiple-validation-rules-to-one-component.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Check for number of days:&lt;/p&gt;
&lt;p&gt;tointeger(today() - date(2021,1,1)) &amp;gt; 365&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>