How to use paginate with a date filter? Assuming that I’ve a total number of 10 entries in my section('exhibitions') where 8 of them have their entry.endingDate &lt; now, I limit the display to 8 entries but the paginate shows a next button whereas the next page is empty:

{% paginate craft.entries.section('exhibitions').limit(8) as pastExhibitions %}
    {% for entry in pastExhibitions %}
        {% if entry.endingDate &lt; now %}
            …
        {% endif %}
    {% endfor %}

    {% if paginate.prevUrl %}
        &lt;a href="{{ paginate.prevUrl }}" class="button previous"&gt;&amp;larr; Précédent&lt;/a&gt;
    {% endif %}
    {% if paginate.nextUrl %}
        &lt;a href="{{ paginate.nextUrl }}" class="button next"&gt;Suivant &amp;rarr;&lt;/a&gt;
    {% endif %}

{% endpaginate %}


How can I add a date filter, in this case &lt; now, to the paginate configuration in order to only paginate on entries that are &lt; now?
{% paginate craft.entries.section('exhibitions').endingDate('&lt; ' ~ now).limit(8) as pastExhibitions %}
  ...
{% endpaginate %}


This will paginate the entries in section exhibiitions with endingDate &lt; now. That ~ is string concatination operator. The string '&lt; 2014-08-04' queries for entries with endingDate in the past.