Time ago filter?

Eli Dupuis's Avatar

Eli Dupuis

10 Mar, 2011 06:00 PM via web

Is there a way do a time ago filter on a date? I know there's a Rails helper that does it...

  1. Support Staff 2 Posted by Steve Smith on 10 Mar, 2011 06:05 PM

    Steve Smith's Avatar

    Because we cache your pages pretty aggressively, we don't allow time_ago style dating. Fortunately, there's a much better alternative than hard-coding the time_ago in your page (which will get old and inaccurate over the life of your page, even in a browser window over a few minutes.)

  2. Support Staff 3 Posted by Steve Smith on 10 Mar, 2011 06:09 PM

    Steve Smith's Avatar

    Looks like my response didn't get fully included. Here's the rest:

    By using something like http://timeago.yarp.com/ you can put the normal date in your page, along with the iso date (Harmony provides a filter for this) as an attribute, and JavaScript will turn that into a 'time ago.' If the user doesn't have javascript, they simply get the standard formatted date.

  3. 4 Posted by Eli Dupuis on 10 Mar, 2011 06:16 PM

    Eli Dupuis's Avatar

    Cool. Thanks for the tip.

  4. Eli Dupuis closed this discussion on 10 Mar, 2011 06:53 PM.

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