<p>Thanks to Brandon Kelly's help I now have Events being filtered by my custom date field called <code>eventDate</code> by doing the following:</p>

<pre><code>{% set day = date(craft.request.getSegment(2)) %}
{% set nextDay = day|date_modify('+1 day') %}
{% set events = craft.entries.eventDate('and, &gt;= '~day|date('Y-m-d')~', &lt;'~nextDay|date('Y-m-d')) %}
</code></pre>

<p>I have some links in my side bar that append the appropriate Date to the URL:</p>

<pre><code>&lt;a href="{{ url('events/'~now|date('Y-m-d')) }}"&gt;Today&lt;/a&gt;
&lt;a href="{{ url('events/'~nextDay|date('Y-m-d')) }}"&gt;Tomorrow&lt;/a&gt;
</code></pre>

<p>And finally I just loop that through like so:</p>

<pre><code>{% for block in events %}{% endfor %}
</code></pre>

<p>I hope someone else can find this as handy as I did through Brandon's help!</p>

CC BY-SA 3.0
2017-04-15T14:01:05.770Z
This thread will come in handy as we need to do something similar on the site we just started building. Thanks for posting it!
Ryan Masuga
CC BY-SA 3.0
2014-06-13T23:23:54.993Z
This awesome and a great example of Twig's awesomeness.
James Muspratt
CC BY-SA 3.0
2014-06-13T21:59:19.070Z
2014-06-13T21:59:19.070Z
Mark Busnelli Jr
<p>I am trying to setup an events section similar to that of Yelp's Events.  They have a listing of all the upcoming events and have filters on the side for "Today, Tomorrow" etc...</p>

<p>I received help from Brandon Kelly and will be posting my answer below.</p>

CC BY-SA 3.0
2014-06-13T22:12:43.113Z
This seems like a valuable Q&A, Mark. I think the question could be better if it was more descriptive and self-contained, leaving room for other answers if any are so bold as to compete with Mr. Kelly. I enjoy pretending I'm two different people asking and answering, though I can follow up on that with a therapist.
Matt Stein
<entries><date><datetime>
How Do I show advanced Date filters for Events?
# How Do I show advanced Date filters for Events?

(Asked by: username_0 on 2014-06-13)

I am trying to setup an events section similar to that of Yelp's Events. They have a listing of all the upcoming events and have filters on the side for "Today, Tomorrow" etc...

I received help from Brandon Kelly and will be posting my answer below.

**Tags:** entries, date, datetime
> **Comments:**
> **username_1**: This seems like a valuable Q&A, Mark. I think the question could be better if it was more descriptive and self-contained, leaving room for other answers if any are so bold as to compete with Mr. Kelly. I enjoy pretending I'm two different people asking and answering, though I can follow up on that with a therapist.  

---

## 1 answers

### Answer by username_0 on 2014-06-13. Score: 6

Thanks to Brandon Kelly's help I now have Events being filtered by my custom date field called eventDate by doing the following:
{% set day = date(craft.request.getSegment(2)) %}
{% set nextDay = day|date_modify('+1 day') %}
{% set events = craft.entries.eventDate('and, >= '~day|date('Y-m-d')~', <'~nextDay|date('Y-m-d')) %}

I have some links in my side bar that append the appropriate Date to the URL:
Today
Tomorrow

And finally I just loop that through like so:
{% for block in events %}{% endfor %}

I hope someone else can find this as handy as I did through Brandon's help!

> **Comments:**
> **username_3**: This awesome and a great example of Twig's awesomeness.  
> **username_2**: This thread will come in handy as we need to do something similar on the site we just started building. Thanks for posting it!  

---

