Coaxing data to dates and comparing?
Is it possible to compare two fields as dates?
I want to do something like this:
{% capture event_date %}{{ event.day }} {{ event.month }} {{ event.year }}{% endcapture %}
{{ event_date | isodate | assign_to: 'event_date' }}
{{ 'now' | date: '%d %M %Y' | isodate | assign_to: 'today' }}
{% if event_date >= today %}
... do something ...
{% endif %}
Any suggestions?
Comments are currently closed for this discussion. You can start a new one.
2 Posted by Jonathan Hoyt on 20 Dec, 2010 02:19 PM
We don't have a date field type yet, but we do have an issue created to get that done. How urgently do you need it? I can bump up the priority on that issue if need be.
3 Posted by Galen King on 20 Dec, 2010 05:52 PM
Not urgent but pretty important.
Galen
Sent from my iPhone
4 Posted by Jonathan Hoyt on 21 Dec, 2010 02:47 PM
Understood. I'll go ahead and bump up the priority.
Jonathan Hoyt closed this discussion on 21 Dec, 2010 02:47 PM.