<?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 Range validation</title><link>https://community.appian.com/discussions/f/rules/28508/date-range-validation</link><description>Hi , 
 I have a list of dictionaries with date ranges(refer below screenshot) 
 
 
 i need validation that if i give a date and if the given date is overlapped with any of the dates(start and end date) i should get a validation. 
 for example; 
 start</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Date Range validation</title><link>https://community.appian.com/thread/111831?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2023 15:04:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:37e7875a-8471-48c0-b421-6511ae4b69f6</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;This is a code snippet that checks one range against other ranges and returns true if there is an overlap.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!ranges: {
    a!map(start: date(2023, 1, 10), end: date(2023, 1, 20)),
    a!map(start: date(2023, 2, 12), end: date(2023, 3, 1)),
  },
  local!new: a!map(start: date(2023, 1, 15), end: date(2023, 2, 1)),
  a!forEach(
    items: local!ranges,
    expression: and(
      local!new.start &amp;lt;= fv!item.end,
      local!new.end &amp;gt;= fv!item.start
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date Range validation</title><link>https://community.appian.com/thread/111820?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2023 13:48:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3385fdde-a042-4dea-a0a3-3c5ce62ab952</guid><dc:creator>Druva</dc:creator><description>&lt;p&gt;Hi Stefan,&lt;/p&gt;
&lt;p&gt;In simple terms employee is applying for leave and if user want to apply for new leave or edit applied leave there should not be overlapping between existing leaves applied.&lt;/p&gt;
&lt;p&gt;I just have UI with start date and end date, once user submits the form data is stored in database. while&amp;nbsp;changing the dates in&amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;the ui again there should not be overlap.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date Range validation</title><link>https://community.appian.com/thread/111818?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2023 13:42:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:003fae36-a68a-4736-82b4-c1493dd3d45b</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Operators in Appian can easily compare a value against a list of values. Depending on your exact requirement, this should be pretty simple.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!ranges: {
    a!map(start: date(2023, 1, 1), end: date(2023, 2, 1)),
    a!map(start: date(2023, 2, 1), end: date(2023, 3, 1)),
  },
  local!date: date(2023, 1, 15),
  {
    local!date &amp;gt;= local!ranges.start,
    local!date &amp;lt;= local!ranges.end
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date Range validation</title><link>https://community.appian.com/thread/111816?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2023 13:37:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:026b63d4-81f7-414f-b8dd-0d4110b8908f</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Ready to help. Can you share your existing code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>