<p>You should be able to just compare the two dates directly.</p>

<pre><code>{% if entry.promoEndDate &gt;= now %}
    &lt;p class="price--notes"&gt;Price valid until {{ entry.promoEndDate|date('d M Y') }}&lt;/p&gt;
{% endif %}
</code></pre>

CC BY-SA 3.0
2015-05-04T05:51:40.163Z
2015-05-04T06:12:41.670Z
2015-05-04T06:12:41.670Z
Douglas McDonald
<p>Hi I'm trying to template out a simple conditional that shows content if the date set in a date field is greater or equal to today, and I can't seem to get the syntax quite right.</p>

<p>I have tried this:</p>

<pre><code>{% if entry.promoEndDate|date ('&gt;= ' ~ now) %}
    &lt;p class="price--notes"&gt;Price valid until {{ entry.promoEndDate | date('d M Y') }}&lt;/p&gt;
{% endif %}
</code></pre>

<p>And this:</p>

<pre><code>{% if entry.promoEndDate | date &gt;= now | date %}
    &lt;p class="price--notes"&gt;Price valid until {{ entry.promoEndDate | date('d M Y') }}&lt;/p&gt;
{% endif %}
</code></pre>

<p>Both don't yield the result I'm looking for.
Probably missing something really simple here but looked at it too long now.</p>

<p>Thanks in advance</p>

<conditional>
Date specific conditional
# Date specific conditional

(Asked by: username_0 on 2015-05-04)

Hi I'm trying to template out a simple conditional that shows content if the date set in a date field is greater or equal to today, and I can't seem to get the syntax quite right.
I have tried this:
{% if entry.promoEndDate|date ('>= ' ~ now) %}
    Price valid until {{ entry.promoEndDate | date('d M Y') }}
{% endif %}

And this:
{% if entry.promoEndDate | date >= now | date %}
    Price valid until {{ entry.promoEndDate | date('d M Y') }}
{% endif %}

Both don't yield the result I'm looking for.
Probably missing something really simple here but looked at it too long now.
Thanks in advance

**Tags:** conditional

---

## 1 answers

### Answer by username_1 on 2015-05-04. Score: 1 | Accepted answer

You should be able to just compare the two dates directly.
{% if entry.promoEndDate >= now %}
    Price valid until {{ entry.promoEndDate|date('d M Y') }}
{% endif %}


---

