Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Expiry date format in email templates

  • karencheah
  • karencheah's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
8 years 7 months ago #123372 by karencheah
Expiry date format in email templates was created by karencheah
Hi, may I know how I can change the expiry date field format in the email templates from yyyy-mm-dd to de-mm-yyyy? I have tried changing the date format in the text elements of the survey but that makes no difference to the expiry date field format. Can anyone advise if the format is fixed? Thanks in advance.
The following user(s) said Thank You: JiangHongTiao
The topic has been locked.
More
8 years 6 months ago #124637 by JiangHongTiao
Replied by JiangHongTiao on topic Expiry date format in email templates
I have experienced the same issue and I cannot find it in settings.
The topic has been locked.
More
8 years 1 month ago #130328 by saltheart
Replied by saltheart on topic Expiry date format in email templates
I'm trying to include EXPIRY in the Reminder email template. This works:

{date('l\, F j\, Y',strtotime('2016-01-28'))}

This does NOT work:

{date('l\, F j\, Y',strtotime(EXPIRY))}

In fact, I can't even get this to work: {strtotime(EXPIRY)}, although if I "Validate expression in Reminder" it is able to show me the value of EXPIRY. Is there something else I must do to get it to evaluate EXPIRY in the expression?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 1 month ago #130333 by tpartner
Replied by tpartner on topic Expiry date format in email templates
What is your survey date format?

I find that {date('l\, F j\, Y',strtotime(EXPIRY))} works with the following formats:
  • dd.mm.yyyy
  • dd-mm-yyyy
  • d-m-yyyy
  • d.m.yyyy
  • yyyy-mm-dd
  • yyyy/mm/dd
  • mm/dd/yyyy

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
8 years 1 month ago #130335 by saltheart
Replied by saltheart on topic Expiry date format in email templates
The date for this particular survey is displayed as 28.01.2016 00:00. However, when I "Validate Expression in Reminder" and hover over EXPIRY it displays "; Value= 28.01.2016". Where do I change the survey date format?

Incidentally, this text: This survey will be closing on {date('l\, F j\, Y',strtotime('2016-01-28'))}. {strtotime(EXPIRY)}

Translates to this text in the email: This survey will be closing on Thursday, January 28, 2016. strtotime(EXPIRY)

And of course if I substitute the hard-coded date (2016-01-28) with EXPIRY then it translates to: This survey will be closing on date('l\, F j\, Y', strtotime(EXPIRY)). strtotime(EXPIRY)
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 1 month ago - 8 years 1 month ago #130337 by tpartner
Replied by tpartner on topic Expiry date format in email templates
The date format is set in Survey properties --> Edit text elements --> Date format


Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 8 years 1 month ago by tpartner.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 1 month ago #130346 by DenisChenu
Replied by DenisChenu on topic Expiry date format in email templates
HI,

LimeSurvey version and build number ?

github.com/LimeSurvey/LimeSurvey/commit/...41989578c9d5aa451ad2

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
More
8 years 1 month ago #130377 by saltheart
Replied by saltheart on topic Expiry date format in email templates
Version 2.06+ Build 151205
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 1 month ago #130379 by tpartner
Replied by tpartner on topic Expiry date format in email templates
Can you please update to the latest release and retest?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: saltheart
The topic has been locked.
More
8 years 1 month ago #130380 by saltheart
Replied by saltheart on topic Expiry date format in email templates
That fixed it. Thanks!

I guess I should have tried that first. :)
The topic has been locked.
More
7 years 11 months ago #133686 by first
Replied by first on topic Expiry date format in email templates
I also trying to add expiry email in email template but I get junk HTML :
Code:
<span class='em-expression em-haveerror'><span title='Format a local date/time; string date(format [, timestamp=time()])' class='em-function' >date</span>(<span title='' class='em-var-string'>'l\, F j\, Y'</span>, <span title='Convert a date/time string to unix timestamp; int strtotime(string)' class='em-function' >strtotime</span>(<span title='Undefined variable' class='em-error'><span title='Undefined variable' class='em-var em-var-error' >EXPIRY</span></span>))</span>

Anything you guess I am doing wrong...

Version 2.06+ Build 150612

Survey Designer and Programmer
The topic has been locked.
More
7 years 11 months ago #133694 by first
Replied by first on topic Expiry date format in email templates
Update : I got rid of junk html by changing the setting : Use HTML format for token emails? --> Yes , but it still shows {date('l\, F j\, Y',strtotime(EXPIRY))} . I have also tried with date format as mm/dd/yyyy .

Survey Designer and Programmer
The following user(s) said Thank You: dahuja123
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose