Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Add days (variable) to date

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
oppenhe1mer
Smarty n00b


Joined: 07 Apr 2017
Posts: 1

PostPosted: Fri Apr 07, 2017 11:16 am    Post subject: Add days (variable) to date Reply with quote

Hey guys,

i looked up the forum and also google but didnt find a way that works.


Ive got two variables - one with a date and one just with a number - i just want to add the second variable to the date and after that format the whole thing.

To be more precisely:

$order->created (thats the date)
$order->estShipping (amount of days)

i know this doesnt work but i want sth like that:

{$order->created + $order->estShipping|date_format:"%Y-%m-%d"}

any ideas? Smile
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1718

PostPosted: Fri Apr 07, 2017 12:59 pm    Post subject: Reply with quote

You're adding business logic to the template. Don't do that.
Moreover, your "estShipping" must also be a date already.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP