--- On Wed, 3/16/11, Cees Hek <[email protected]> wrote: > From: Cees Hek <[email protected]> > Subject: Re: [Templates] object stringify in custom filter > To: "James.Q.L" <[email protected]> > Cc: [email protected] > Date: Wednesday, March 16, 2011, 9:51 PM > On Thu, Mar 17, 2011 at 3:11 PM, > James.Q.L <[email protected]> > wrote: > > > > nice to see you again, Cees - We went to the 2006 > chicago yapc from to.pm. but I am now in Beijing. > > I knew I recognized the name but couldn't put a place or a > face to it. > It's all coming back to me now. Makes me want to > head to another > YAPC, but I'm in Sydney Australia these days... >
At least we are still with Perl. I run the chinese perl community (perlchina) and we will organize another perl related workshop this year. let me know if you have any travel plan to china :) > > I have never touched macro before and I ought to learn > more about TT. > > > > By the way. I got a suggestion from Stackoverflow to > use custom plugin or vmethod and I like that way better. > > There is an alternate solution as well. Assuming that > this is for an > HTML page, and you are not against using JavaScript, I have > found the > jquery timeago plugin handy for this type of thing. > (http://timeago.yarp.com/) > > <abbr class="timeago" title="[% date %]">[% > date.strftime('%B %e, %Y > %r') %]</abbr> > <script> > $("abbr.timeago").timeago(); > </script> > > The beauty of this method is that the date is updated in > real time > while the page is left open. So if an event happened > 'a few minutes > ago' when the page was opened and the page was left open > for an hour, > the jquery plugin keeps updating the date to keep the info > current > (see the example page to see how it works). > That's great. The current perl module I am using is actually inspired by it. I may just switch to js version. cheers, James. _______________________________________________ templates mailing list [email protected] http://mail.template-toolkit.org/mailman/listinfo/templates
