Share » Forums » Setup & design » Workaround for subtracting in templates

Workaround for subtracting in templates

Workaround for subtracting in templates

Friday 29 February 2008 12:53:33 am - 1 reply

Author Message

Pascal Specht

Friday 29 February 2008 3:36:46 am

Hi Felix,

certainly $lastweek = add($thisweek,-1) won't work much better because $lastweek is probably not an integer...

What datatype is $lastweek ? If this is inside a module, you may perhaps get around the problem by calculating the value through the php code and using a template variable to get it back?
If $lastweek is a date/time and the operator hasn't been implemented in the template language, you probably will have to write a template operator for this. I always have a small module with useful stuff included in my install, so adding a template operator isn't much work...

</Pascal>

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu