# Bug with date verification

**URL:** <https://community.silverfin.com/t/bug-with-date-verification/1921>\
**Category:** Templates\
**Created:** [September 17, 2020, 1:07pm UTC](https://community.silverfin.com/t/bug-with-date-verification/1921 "2020-09-17T13:07:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gianluca](https://avatars.discourse-cdn.com/v4/letter/g/82dd89/32.png) [@Gianluca](https://community.silverfin.com/u/Gianluca)\
**Post date:** [September 17, 2020, 1:07pm UTC](https://community.silverfin.com/t/bug-with-date-verification/1921/1 "2020-09-17T13:07:29Z")

</div>

Hi,

I’ve been trying to make a verification of 2 dates in an if-statement.  
As long as the date that has been filled in is still in September (I guess same month as _now\_plus7_) , no issues. Verification works as it should. Once I select a day in October, verification fails.

Simplified version of the code:

```
{% assign now_plus7 = "now" as:date | advance_day: 7 | date:"%d/%m/%Y" %}
{% input period.custom.date.date as:date %}

Date1: {{ now_plus7 }} (today +7 days)
Date2: {{ period.custom.date.date }}

{% if period.custom.date.date < now_plus7 %}Date1 bigger{% else %}Date2 bigger{% endif %}

```

Is there something wrong with the code? I’m almost certain it used to work properly which makes me think it’s not related to the code but rather a bug.

Thanks in advance for your insights.

---

<div class="post-metadata">

**Author:** ![robindeclercq](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/robindeclercq/32/472_2.png) [@robindeclercq](https://community.silverfin.com/u/robindeclercq)\
**Post date:** [September 17, 2020, 2:01pm UTC](https://community.silverfin.com/t/bug-with-date-verification/1921/2 "2020-09-17T14:01:48Z")

</div>

Hi @Gianluca,

Thanks for this clearly explained question and code snippet.

I had a look at your simplified code and indeed this does not seem to behaving as expected. I’ll check this further internally, and come back to you as soon as I receive any feedback.

Keep you posted!

Kind regards,  
Robin

---

<div class="post-metadata">

**Author:** ![robindeclercq](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/robindeclercq/32/472_2.png) [@robindeclercq](https://community.silverfin.com/u/robindeclercq)\
**Post date:** [September 17, 2020, 3:05pm UTC](https://community.silverfin.com/t/bug-with-date-verification/1921/3 "2020-09-17T15:05:59Z")

</div>

Hi @Gianluca,

You cannot use the date filter when creating a local var (i.e. `now_plus7`) .

If you remove this date filter (`date:"%d/%m/%Y"`) it will work fine. Filters should only be used for presentation purposes.

Hope this resolves your issue!

Kind regards,  
Robin

---

<div class="post-metadata">

**Author:** ![Gianluca](https://avatars.discourse-cdn.com/v4/letter/g/82dd89/32.png) [@Gianluca](https://community.silverfin.com/u/Gianluca)\
**Post date:** [September 17, 2020, 3:42pm UTC](https://community.silverfin.com/t/bug-with-date-verification/1921/4 "2020-09-17T15:42:03Z")

</div>

It’s working, thanks!
