<p>You can add it like every other criteria property</p>

<pre><code>craft.entries.date('&gt;' ~ now|date_modify('-1 day')|atom) 
</code></pre>

CC BY-SA 4.0
2018-11-01T13:09:04.347Z
2018-11-01T13:09:04.347Z
Robin Schambach
<p>How can I incorporate the date_modify into the craft.entries query so that the pagination takes into account this criteria? At the moment the limit is also accounting for past entries and I'm hitting errors whatever I try.</p>

<pre><code>{% paginate craft.entries.section('events').limit(10).order('date asc') as entries %}

    {% for entry in entries if entry.date &gt; now|date_modify('-1 day')  %}

        ...

    {% endfor %}


    {% include "includes/_pagination" %}
</code></pre>

<datetime><pagination>
Pagination with if statement date modify
# Pagination with if statement date modify

(Asked by: username_0 on 2018-11-01)

How can I incorporate the date_modify into the craft.entries query so that the pagination takes into account this criteria? At the moment the limit is also accounting for past entries and I'm hitting errors whatever I try.
{% paginate craft.entries.section('events').limit(10).order('date asc') as entries %}

    {% for entry in entries if entry.date > now|date_modify('-1 day')  %}

        ...

    {% endfor %}


    {% include "includes/_pagination" %}

**Tags:** datetime, pagination


---

## 1 answers

### Answer by username_1 on 2018-11-01. Score: 1 | Accepted answer

You can add it like every other criteria property
craft.entries.date('>' ~ now|date_modify('-1 day')|atom)


---

