Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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'}) %}
    <a class="eventSummary" href="{{ event.url }}">
        <span class="date">{{ event.eventDate }}</span>
        <span class="eventTitle">{{ event.title }}</span>
{% 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.

share|improve this question
up vote 6 down vote accepted

I think .after would work, but I've used this way:

{% set entries = craft.entries.section('events').limit(null) %}

{% for entry in entries.eventDate('>=' ~ ('eventDate DESC') %}
    {# Show entry #}  
{% endfor %}
share|improve this answer
Thanks. This worked. – jeff_nordstedt Jul 22 '14 at 20:22

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') %}


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.