On Mon, Jun 25, 2012 at 6:26 AM, Daniel Roseman <dan...@roseman.org.uk> wrote: > > On Monday, 25 June 2012 13:05:24 UTC+1, larry....@gmail.com wrote: >> >> I'm trying to use now in an if like this: >> >> {% if value|date:"Ymd" == now "Ymd" %} >> >> This is failing with: 'Unused '"Ymd"' at end of if expression.' >> >> If I quote it: >> >> {% if value|date:"Ymd" == 'now "Ymd"' %} >> >> I don't get the syntax error, but the if does not evaluate to true >> when the dates match. >> >> I need to see if the date in {{ value }} is `today' - how can I do that? >> >> -larry > > > Write a custom "is_today" filter. Two lines of code.
Thanks for the reply. I ended up doing what I needed in python on the sever. So I guess there is no way to use now in an if? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.