Dependency Graph

Dependency Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
17089Bug reportsSurvey participants (Tokens)public2021-03-08 12:29
Reportergabrieljenik Assigned Togabrieljenik  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version4.4.4 
Summary17089: Date format problem
Description

I think Limesurvey's defalut date format is dd.mm.yyyy. If the date format is changed to mm.dd.yyyy, A wrong date(month and day are switched) is being loaded on the sent or reminder sent date field when you try to edit a survey participant token information.

For an example, If 'sent' or 'reimindersent' date was 1.12.2021(Jan. 12 2021), 12.1.2021(Dec. 1 2021) is loaded.

If it was 1.13.2021(Jan. 13 2021), 01-01-1800 is loaded because month 13 doesn't exist.

I believe it's because database date type for 'sent' and 'remindersent' fields are string, not datetime like validfrom or validuntil fields so the personal date format selection is not working correctly.

Steps To Reproduce
  1. Change the Date Format to mm.dd.yyyy at My Personal Setting.
  2. Create a token and send the invitation out.
  3. Click 'Edit' on the token.
  4. Date/Time field for Sent or Reminder Sent will load the wrong date that month and day are switched.
Additional Information

I have tested it on 3.25.4 (Your hosting server version) and on Version 4.3.33(Your Demo server version) and all have the same problem.

This is a clone from 16976.
This one is for LS4

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)Version 4.4.4
I will donate to the project if issue is resolvedNo
BrowserGoogle Chrome
Database type & versionMS SQL 12.00.6024
Server OS (if known)Windows NT 10.0 build 14393 (Windows Server 2016) AMD64
Webserver software & version (if known)Microsoft-IIS/10.0
PHP Version7.3.11

Relationships

related to 16976 closedgabrieljenik Date format problem 

Activities

gabrieljenik

gabrieljenik

2021-02-12 16:17

manager   ~62219

Last edited: 2021-02-12 16:17

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

This patch is for the edit tokens screen.
This happens because the dates are somehow double converted (calling 2 times convertToGlobalSettingFormat)

This was already fixed for the invitation sent date. Now doing it for the reminder date.

gabrieljenik

gabrieljenik

2021-02-12 16:20

manager   ~62220

Plase take into account these kind of erros can also happen on other parts of the code.

Also, please take into account that convertToGlobalSettingFormat uses
$oDate = new DateTime($sDate); // We generate the Date object (PHP will deal with the format of the string)

This is like using strToTime and allowing PHP make their best guess.
This could lead to some unexpected results

gabrieljenik

gabrieljenik

2021-02-25 19:44

manager   ~62536

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

lime_release_bot

lime_release_bot

2021-03-08 12:29

administrator   ~62884

Fixed in Release 4.4.11+210301

Related Changesets

LimeSurvey: master 5f2cb1ed

2021-02-25 19:44:29

gabrieljenik


Committer: GitHub Details Diff
Fixed issue 17089: Date format problem (#1760)

This patch is for the edit tokens screen.
This happens because the dates are somehow double converted (calling 2 times convertToGlobalSettingFormat)

This was already fixed for the invitation sent date. Now doing it for the reminder date.
Affected Issues
17089
mod - application/views/admin/token/tokenform.php Diff File

Issue History

Date Modified Username Field Change
2021-02-12 16:13 gabrieljenik New Issue
2021-02-12 16:13 gabrieljenik Issue generated from: 16976
2021-02-12 16:17 gabrieljenik Note Added: 62219
2021-02-12 16:17 gabrieljenik Note Edited: 62219
2021-02-12 16:20 gabrieljenik Note Added: 62220
2021-02-12 16:23 gabrieljenik Relationship added related to 16976
2021-02-25 19:44 gabrieljenik Changeset attached => LimeSurvey master 5f2cb1ed
2021-02-25 19:44 gabrieljenik Note Added: 62536
2021-02-25 19:44 gabrieljenik Assigned To => gabrieljenik
2021-02-25 19:44 gabrieljenik Resolution open => fixed
2021-02-25 19:44 ollehar Status new => resolved
2021-03-08 12:29 lime_release_bot Note Added: 62884
2021-03-08 12:29 lime_release_bot Status resolved => closed