Jump to content

DD/MM/YYYY + 1


didier1

Recommended Posts

Hello, I'm trying to build an email template that will use a custom field date that  is  already created with this format  (DD/MM/YY) and will add 1 day or 1 month depending of our needs as follow.

We are working on something like that but need help for the syntax 

{$service_custom_fields.0 + 1 } 

( will give 31 on a custom field value of 30/06/2018 - we are expecting 01/07/2018

Do we need to convert that value into number and than add +1 than reconverting ? 

many thanks again guys

 

 

Link to comment
Share on other sites

Hello Brian, some how when I use 

19 hours ago, brian! said:

{"$service_custom_fields.0 +1 Day"|date_format:'d/m/Y'}

it give me today's datre - Note that my custom field value is a text box : 30/06/2018 - The expected result is 01/07/2018.

I have the same result with or without the  '+1 day'

Somehow the date format that we are trying to specify reverts the custom field to today's date without considering our teh + 1 day we would like to use

I'm using WHMCS V7.4.1

thank you in advanced

Link to comment
Share on other sites

ah ok, it's not liking the date format of the custom field... I should have remembered what I posted in the thread below... i'll blame it on the time of year and my head being elsewhere! :135_santa:

{$service_custom_fields.0|replace:'/':'-'|cat:' +1 day'|date_format:'%d/%m/%Y'}

for me, this is working in v7.4.1 in an email template - the image below shows {$service_custom_fields.0} and the above code...

BARfKGx.png

if you want to add 1 month, then just change +1 day to +1 month in the code... if it's more than one day, use days; similarly for weeks, months, years etc.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated