ecocode wrote:
Hi,

I'd like to insert a calculated date in a template .

I tried this :

[% USE date %]
[% calc = date.calc ; monday = calc.Today_and_Now ; monday = 
Add_Delta_Days(monday,7) %]
[% monday.join('/') %]

But it does not work. I think it is due to the format of monday which I
think should be 3 vars...

Any idea cos I'm blocking on this :-/

Well, you're right that you need to get the three individual parts of monday to pass into Add_Delta_Days. But you also need to call Add_Delta_Days as a method on the calc object. This seems to work:

[% USE date %]
[% calc = date.calc ; monday = calc.Today_and_Now ; monday = calc.Add_Delta_Days(monday.0,monday.1,monday.2,7) %]
[% monday.join('/') %]

Dave...

--
Site: http://dave.org.uk/
Blog: http://blog.dave.org.uk/
Code: http://dave.org.uk/code/

_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to