Relationship Graph

Relationship Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
18337Bug reportsSurvey editingpublic2023-01-31 17:28
ReporterMazi Assigned Togabrieljenik  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version5.3.x 
Summary18337: Placeholders VALIDFROM and VALIDUNTIL at email templates do not use localized dates
Description

When using {VALIDFROM} or {VALIDUNTIL} placeholders at email templates, the date format is always like 2022-10-07 13:27:00. Even when adjusting the date format at the survey text settings, this doesn't change.
I also tried adding German as second language because that uses a different date format but the results were the same when sending emails.

Steps To Reproduce

Steps to reproduce

  1. Set a test survey to use a date format like dd.mm.yyyy.
  2. Enable tokens, add a test token with a past "valid from" and future "valid until" date.
  3. Edit the email template to include placeholders {VALIDFROM} or {VALIDUNTIL}.
  4. Send yourself a test email and check the date details.

Expected result

Date format of these dates should be localized according to survey settings.

Actual result

Date format is always yyyy-mm-dd

TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)Version 5.3.32+220817
I will donate to the project if issue is resolvedNo
BrowserChrome
Database type & versionMariaDB 10.1.48
Server OS (if known)Ubuntu 20
Webserver software & version (if known)Apache 2.0
PHP Version8.1

Relationships

related to 18336 closedollehar Placeholder fields VALIDFROM and VALIDUNTIL not listed at email templates 

Activities

Mazi

Mazi

2022-09-08 15:40

updater   ~71659

@gabrieljenik, would it be possible to fix this short term? We need proper date display for a project starting in 1-2 weeks.

gabrieljenik

gabrieljenik

2022-09-08 17:12

manager   ~71660

I will catch it in the next few days.
Still, I guess you will need to apply the patch maually on your env.

gabrieljenik

gabrieljenik

2022-09-09 16:57

manager   ~71668

PR: https://github.com/LimeSurvey/LimeSurvey/pull/2591

gabrieljenik

gabrieljenik

2022-09-09 16:58

manager   ~71669

@mazi ready for you to grab it.
I guess you will be the firt to review it, so your usage can be considered a test :)

DenisChenu

DenisChenu

2022-09-09 17:32

developer   ~71670

I'm against update it directly

  1. It can broke current usage in survey : {VALIDUNTIL < EXPIRY} or {date("d/m/Y",strtotime(VALIDFROM))}
  2. If we send it updated : admin can not use own date formar : showing only month for example : {date("m",strtotime(VALIDFROM))}
  3. Here you show the time and second … in general : admin user want only day …
  4. You can show it according to your need now without update

Maybe add it as VALIDUNTIL_FORMATED or something like this … but since second is rarely needed …

Mazi

Mazi

2022-09-10 13:10

updater   ~71672

@gabrieljenik: Tested, works as expected.

@DenisChenu, I understand your objections. Are you using any such date comparisons or date formatting functions within your admin emails?
Using different placeholders as suggested could be a good solution.

@c_schmitz, your opinion?

gabrieljenik

gabrieljenik

2022-11-11 14:01

manager   ~72704

Tested OK.

gabrieljenik

gabrieljenik

2022-12-01 10:07

manager   ~72956

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=34065

LimeBot

LimeBot

2022-12-05 10:35

administrator   ~72994

Fixed in Release 5.4.14+221205

gabrieljenik

gabrieljenik

2023-01-31 17:28

manager   ~73620

Automatic Test: https://github.com/LimeSurvey/LimeSurvey/pull/2880/

Related Changesets

LimeSurvey: master e54d2f53

2022-12-01 10:07:53

gabrieljenik


Committer: GitHub Details Diff
Fixed issue 18337: Placeholders VALIDFROM and VALIDUNTIL at email templates do not use localized dates (#2591)

- Added a 'dateFunctions' core plugin with new EM function: localize_date(date, language)
- Make language parameter optional on localize_date()
Co-authored-by: encuestabizdevgit <devgit@encuesta.biz>
Affected Issues
18337
add - application/core/plugins/dateFunctions/EMFunctions.php Diff File
add - application/core/plugins/dateFunctions/config.xml Diff File
add - application/core/plugins/dateFunctions/dateFunctions.php Diff File

Issue History

Date Modified Username Field Change
2022-09-08 13:35 Mazi New Issue
2022-09-08 13:36 Mazi Relationship added related to 18336
2022-09-08 15:40 Mazi Note Added: 71659
2022-09-08 15:40 Mazi Bug heat 0 => 2
2022-09-08 17:12 gabrieljenik Assigned To => gabrieljenik
2022-09-08 17:12 gabrieljenik Status new => confirmed
2022-09-08 17:12 gabrieljenik Note Added: 71660
2022-09-08 17:12 gabrieljenik Bug heat 2 => 4
2022-09-08 17:22 gabrieljenik Status confirmed => assigned
2022-09-09 16:57 gabrieljenik Status assigned => ready for code review
2022-09-09 16:57 gabrieljenik Note Added: 71668
2022-09-09 16:58 gabrieljenik Note Added: 71669
2022-09-09 17:32 DenisChenu Note Added: 71670
2022-09-09 17:32 DenisChenu Bug heat 4 => 6
2022-09-10 13:10 Mazi Note Added: 71672
2022-11-11 14:01 gabrieljenik Assigned To gabrieljenik => ollehar
2022-11-11 14:01 gabrieljenik Status ready for code review => ready for merge
2022-11-11 14:01 gabrieljenik Note Added: 72704
2022-12-01 10:07 gabrieljenik Changeset attached => LimeSurvey master e54d2f53
2022-12-01 10:07 gabrieljenik Note Added: 72956
2022-12-01 10:07 gabrieljenik Assigned To ollehar => gabrieljenik
2022-12-01 10:07 gabrieljenik Resolution open => fixed
2022-12-05 10:35 LimeBot Note Added: 72994
2022-12-05 10:35 LimeBot Status ready for merge => closed
2022-12-05 10:35 LimeBot Bug heat 6 => 8
2023-01-31 17:28 gabrieljenik Note Added: 73620