Re: Time & Date calculation in template

2009-05-13 Thread Gath
I use javascript to do this sort of thing eg. in your template call javascript function eg. result = yearsBeforeToday('{{ model.date|date:"Y-m-d H:i:s" }}'); yearsBeforeToday is javascript function, does all the calculation for your date. model.date is the date value you are getting from

Re: Time & Date calculation in template

2009-05-13 Thread Michael Radziej
On Wed, May 13, Joshua Partogi wrote: > Dear all, > > Is it possible to do time and or date calculation in the template? > > Let's say I have a DateField {% now %} and want to subtract it with an > IntegerField (let's say 4, to get 4 years before today) in the template. If > it's possible,

Time & Date calculation in template

2009-05-13 Thread Joshua Partogi
Dear all, Is it possible to do time and or date calculation in the template? Let's say I have a DateField {% now %} and want to subtract it with an IntegerField (let's say 4, to get 4 years before today) in the template. If it's possible, what is the syntax for it? Thank you very much in