django ifequal naturalday
Posted
by Scott Willman
on Stack Overflow
See other posts from Stack Overflow
or by Scott Willman
Published on 2010-03-13T05:15:49Z
Indexed on
2010/03/13
5:25 UTC
Read the original article
Hit count: 240
I'm not sure why, but this condition will never evaluate True for me. I'm feeding it datetime.today() in the urls file. Am I missing something?
Template:
{% load humaize %}
{{ entry.date|naturalday }} {# Evals to "today" #}
{% ifequal entry.date|naturalday "today" %}
True
{{ entry.date|date:"fA"|lower }} {{ entry.date|naturalday|title }}
{% else %}
False
{{ entry.date|naturalday|title }}
{% endifequal %}
© Stack Overflow or respective owner