<p>You could use my <a href="https://github.com/carlcs/craft-autoexpire" rel="nofollow">Auto Expire</a> plugin to make those entries expire after the event is over. Just add a new expiration rule for that section with the expiration date set to:</p>

<pre><code>{ konzertdatum|date_modify('+3 days 5am')|date('c') }
</code></pre>

CC BY-SA 3.0
2015-05-15T10:27:42.080Z
This is great! Thank you. Thats exactly what solves this problem!
KSPR
CC BY-SA 3.0
2015-05-13T16:02:15.543Z
2015-05-13T16:02:15.543Z
carlcs
<p>You can set the <code>Expiration Date</code> in the control panel. It is at the bottom of the column on the right (on wide screens), or at the bottom of the page (on narrow screens). I don't think there is any way to set the Expiration Date from the konzertdatum, so you would have to either use the Expiration Date as the concert date, or maintain both of them.</p>

CC BY-SA 3.0
2014-12-05T10:30:21.553Z
I just find it strange to set an expiration date for a concert. That's counterintuitive nobody does that. One should be able to set the concert date and thats it. Thats why I searched for another way.
KSPR
CC BY-SA 3.0
2014-12-04T19:32:00.743Z
2014-12-04T19:32:00.743Z
Marion Newlevant
<p>Not that this answers your question (Marion did a good job with that), if you stick to your current code I would change it like so:</p>

<pre><code>{% set present = now|date_modify("+1 day") %}
{% for entry in craft.entries.section('concert').konzertdatum('&gt; ' ~ present) %}
    {{ entry.konzertdatum|date('d. M. Y - H:i')}} - Concert Bla
{% endfor %}
</code></pre>

<p>This is how I did it for my event dates, where I didn't want the Client to use the default Expiration date field on the right. One reason for this decision was, that I have more than two dates for my Entry Type (that I theoretically could have used Expiration and Post date for). And I don't want them to be edited all over the place.</p>

CC BY-SA 3.0
2014-12-05T10:31:09.193Z
What does `('> ' ~ present)` do?
KSPR
CC BY-SA 3.0
2014-12-05T11:12:21.850Z
@Kaspar the string `'> '` gets concatenated / joined with the value of your `present` variable, which at this point is a DateTime object, because this is what the `date_modify` filter returns. But Craft is smart enough to convert the DateTime object to a string, so today you would end up with a string of `'> 2014-12-06'`. Used within the `konzertdatum` parameter, it [filters your entries by this condition](http://buildwithcraft.com/docs/templating/elementcriteriamodel#parameter-value-syntax).
carlcs
CC BY-SA 3.0
2014-12-04T22:09:59.360Z
2014-12-04T22:23:53.197Z
2014-12-04T22:23:53.197Z
carlcs
<p>Ich have a concert entry which I want to expire after the concert is over.</p>

<p>How do I do that? </p>

<p>I was able to hide past entries like this:</p>

<pre><code>{% set present = now|date_modify("+1 day") %}
{% for entry in craft.entries.section('concert') %}
     {% if entry.konzertdatum &gt; present %}
       {{ entry.konzertdatum|date('d. M. Y - H:i')}} - Concert Bla
     {% endif %}
{% endfor %}
</code></pre>

<p>But ist it also possible to expire this entry altogether os its marked in the CP?</p>

<p>Or would it be better to use the post_date as a concert timestamp and then show somehow only future dates?</p>

<datetime><expiration>
Expire an entry according to a date field
# Expire an entry according to a date field

(Asked by: username_0 on 2014-12-04)

Ich have a concert entry which I want to expire after the concert is over.
How do I do that? 
I was able to hide past entries like this:
{% set present = now|date_modify("+1 day") %}
{% for entry in craft.entries.section('concert') %}
     {% if entry.konzertdatum > present %}
       {{ entry.konzertdatum|date('d. M. Y - H:i')}} - Concert Bla
     {% endif %}
{% endfor %}

But ist it also possible to expire this entry altogether os its marked in the CP?
Or would it be better to use the post_date as a concert timestamp and then show somehow only future dates?

**Tags:** datetime, expiration


---

## 3 answers

### Answer by username_1 on 2015-05-13. Score: 1 | Accepted answer

You could use my Auto Expire plugin to make those entries expire after the event is over. Just add a new expiration rule for that section with the expiration date set to:
{ konzertdatum|date_modify('+3 days 5am')|date('c') }

> **Comments:**
> **username_0**: This is great! Thank you. Thats exactly what solves this problem!  

---

### Answer by username_2 on 2014-12-04. Score: 2

You can set the `Expiration Date` in the control panel. It is at the bottom of the column on the right (on wide screens), or at the bottom of the page (on narrow screens). I don't think there is any way to set the Expiration Date from the konzertdatum, so you would have to either use the Expiration Date as the concert date, or maintain both of them.

> **Comments:**
> **username_0**: I just find it strange to set an expiration date for a concert. That's counterintuitive nobody does that. One should be able to set the concert date and thats it. Thats why I searched for another way.  

---

### Answer by username_1 on 2014-12-04. Score: 2

Not that this answers your question (Marion did a good job with that), if you stick to your current code I would change it like so:
{% set present = now|date_modify("+1 day") %}
{% for entry in craft.entries.section('concert').konzertdatum('> ' ~ present) %}
    {{ entry.konzertdatum|date('d. M. Y - H:i')}} - Concert Bla
{% endfor %}

This is how I did it for my event dates, where I didn't want the Client to use the default Expiration date field on the right. One reason for this decision was, that I have more than two dates for my Entry Type (that I theoretically could have used Expiration and Post date for). And I don't want them to be edited all over the place.

> **Comments:**
> **username_0**: What does `('> ' ~ present)` do?  
> **username_1**: @Kaspar the string `'> '` gets concatenated / joined with the value of your `present` variable, which at this point is a DateTime object, because this is what the `date_modify` filter returns. But Craft is smart enough to convert the DateTime object to a string, so today you would end up with a string of `'> 2014-12-06'`. Used within the `konzertdatum` parameter, it [filters your entries by this condition](http://buildwithcraft.com/docs/templating/elementcriteriamodel#parameter-value-syntax).  

---

