Current date in templates

Joshua Suggs's Avatar

Joshua Suggs

28 May, 2010 03:39 PM via web

Is there a way to reference the current date from within a template? I tried using {{ now }} but it doesnt appear to return anything.

For example: I have a collection of meetings organized by year and I only want to display the current year's meetings in this template. My thoughts were to use {{ now | date: '%Y' }} to get the current year.

  1. 2 Posted by John Nunemaker on 28 May, 2010 04:05 PM

    John Nunemaker's Avatar

    {{ 'now' | date:'%Y' }} is the most correct way that I can think of.

  2. 3 Posted by Joshua Suggs on 28 May, 2010 06:08 PM

    Joshua Suggs's Avatar

    Ahhh. I left off the quotes around 'now'. Thanks.

  3. 4 Posted by John Nunemaker on 28 May, 2010 06:17 PM

    John Nunemaker's Avatar

    No problem.

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

17 May, 2012 10:45 PM
20 Mar, 2012 05:05 PM
26 Apr, 2012 01:40 AM
07 Mar, 2012 04:42 PM