<p>Actually you should be able to specify your custom field as part of the chained element criteria:</p>

<pre><code>{% set currentAndFutureEvents = craft.entries.section('events').eventDate('&gt;= ' ~ now).order('eventDate DESC') %}
</code></pre>

<p>Source: <a href="https://plus.google.com/111247306448293182882/posts/Uu6ZuTH1NBu">https://plus.google.com/111247306448293182882/posts/Uu6ZuTH1NBu</a></p>

CC BY-SA 3.0
2014-07-22T19:21:09.957Z
2014-07-22T19:21:09.957Z
John D Wells
<p>I think <code>.after</code> would work, but I've used this way:</p>

<pre class="lang-twig prettyprint-override"><code>{% set entries = craft.entries.section('events').limit(null) %}

{% for entry in entries.eventDate('&gt;=' ~ (now.date)).order('eventDate DESC') %}
    {# Show entry #}  
{% endfor %}
</code></pre>

CC BY-SA 3.0
2014-07-22T19:03:10.033Z
2014-07-22T19:03:10.033Z
Simon Kuran
<p>I a trying to display a simple event listing. I set up a custom date field called eventDate to note when the event happens.</p>

<p>This code delivers me the list of events sorted by eventDate:</p>

<pre><code> {% for event in craft.entries.find({section: 'events', order: 'eventDate'}) %}
    &lt;a class="eventSummary" href="{{ event.url }}"&gt;
        &lt;span class="date"&gt;{{ event.eventDate }}&lt;/span&gt;
        &lt;span class="eventTitle"&gt;{{ event.title }}&lt;/span&gt;
    &lt;/a&gt;
{% endfor %}
</code></pre>

<p>However, I want to omit events whose eventDate falls before the current date/time. If it were an entry date I guess I'd just use "after", but I am not sure how to apply that to a custom date field.</p>

<p>Any help is appreciated.</p>

<date><custom-field>
How can I limit a list based on a custom date field
# How can I limit a list based on a custom date field

(Asked by: username_0 on 2014-07-22)

I a trying to display a simple event listing. I set up a custom date field called eventDate to note when the event happens.
This code delivers me the list of events sorted by eventDate:
 {% for event in craft.entries.find({section: 'events', order: 'eventDate'}) %}
    
        {{ event.eventDate }}
        {{ event.title }}
    
{% endfor %}

However, I want to omit events whose eventDate falls before the current date/time. If it were an entry date I guess I'd just use "after", but I am not sure how to apply that to a custom date field.
Any help is appreciated.

**Tags:** date, custom-field

---

## 2 answers

### Answer by username_2 on 2014-07-22. Score: 7 | Accepted answer

I think .after would work, but I've used this way:
{% set entries = craft.entries.section('events').limit(null) %}

{% for entry in entries.eventDate('>=' ~ (now.date)).order('eventDate DESC') %}
    {# Show entry #}  
{% endfor %}


---

### Answer by username_1 on 2014-07-22. Score: 10

Actually you should be able to specify your custom field as part of the chained element criteria:
{% set currentAndFutureEvents = craft.entries.section('events').eventDate('>= ' ~ now).order('eventDate DESC') %}

Source: https://plus.google.com/111247306448293182882/posts/Uu6ZuTH1NBu


---

