Skip to content

Instantly share code, notes, and snippets.

@klickgists
Created August 15, 2013 18:41
Show Gist options
  • Save klickgists/6243515 to your computer and use it in GitHub Desktop.
Save klickgists/6243515 to your computer and use it in GitHub Desktop.
Check dates from entries against current date. For use with #craft CMS.
{% if date >= entry.start|date('Y-m-d') and date < entry.end|date('Y-m-d') %}
<p>current</p>
{% elseif date < entry.start|date('Y-m-d') %}
<p>future</p>
{% elseif date > entry.end|date('Y-m-d') %}
<p>past</p>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment