View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
11417 | Bug reports | Expression Manager | public | 2016-06-26 08:43 | 2016-07-25 13:53 |
Reporter | Isaac007 | Assigned To | |||
Priority | urgent | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 2.50.x | ||||
Fixed in Version | 2.50.x | ||||
Summary | 11417: Dates not calculating properly | ||||
Description | Dates not calculating properly in expression manager since update to V2.50 build 160506 | ||||
Steps To Reproduce | Enter two dates (e.g. TodaysDate and DateOfBirth), equation calculates difference between dates. Equation result always zero. Please see LSS and screenshots. {floor((strtotime(TodaysDate)-strtotime(DateOfBirth))/(606024*365))} | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Bug heat | 8 | ||||
Complete LimeSurvey version number (& build) | 160506 | ||||
I will donate to the project if issue is resolved | Yes | ||||
Browser | Safari V9.1.1 | ||||
Database type & version | MariaDB 5.5.49 | ||||
Server OS (if known) | Linux Diskstation | ||||
Webserver software & version (if known) | Apache HTTP server 5.2 | ||||
PHP Version | 5.6.21 | ||||
First note: It's working with drop down date, so it's probably related to the new date picker. |
|
I did some debugging and find the following behavior: Inside html, the dateformat is saved in a hidden input field (jsName#dateformat), the format used is "DD/MM/YYYY" however the library used to parse dates (date.js) wants lowercased 'd' and 'y' characters, so the format should be: 'dd/MM/yyyy'. However, the date.js library used, was modified for use in LimeSurvey by changing the identifiers (see https://github.com/LimeSurvey/LimeSurvey/blob/master/third_party/jstoolbox/date.js) so the format to be used in limesurvey should be 'dd/mm/yyyy'. However, the bootstrap datepicker uses other identifiers (DD/MM/YYYY). I can create a PR for this particular case, but LouisGac can we have a talk about this first ? Maybe we need a more generic aproach as the dateformat might be an issue on other places ? |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=19709 |
|
Version 2.50+ Build 160725 released |
|
LimeSurvey: master 349e0088 2016-07-22 12:05
Details Diff |
Fixed Issue 11417: Dates not calculating properly dev Please look out for usages of the deprecated jstoolbox/date.js library, though it may be removed in the future dev updated strtotime out of the php.js library |
Affected Issues 11417 |
|
mod - application/helpers/expressions/em_core_helper.php | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-06-26 08:43 | Isaac007 | New Issue | |
2016-06-26 08:43 | Isaac007 | File Added: LimeSurveyBug.zip | |
2016-06-27 10:42 |
|
Sticky Issue | No => Yes |
2016-06-27 11:14 |
|
Note Added: 39802 | |
2016-06-27 14:36 |
|
View Status | private => public |
2016-06-27 19:51 | frederikprijck | Note Added: 39804 | |
2016-07-15 12:32 |
|
Sticky Issue | Yes => No |
2016-07-15 14:49 | c_schmitz | Priority | none => urgent |
2016-07-19 10:58 |
|
Assigned To | => markusfluer |
2016-07-19 10:58 |
|
Status | new => assigned |
2016-07-19 10:59 |
|
Assigned To | markusfluer => |
2016-07-19 10:59 |
|
Status | assigned => new |
2016-07-19 11:15 |
|
Assigned To | => markusfluer |
2016-07-19 11:15 |
|
Status | new => assigned |
2016-07-22 12:11 |
|
Changeset attached | => LimeSurvey master 349e0088 |
2016-07-22 12:11 |
|
Note Added: 40020 | |
2016-07-22 12:11 |
|
Resolution | open => fixed |
2016-07-22 12:40 |
|
Status | assigned => resolved |
2016-07-22 12:40 |
|
Fixed in Version | => 2.5 |
2016-07-25 13:53 | c_schmitz | Note Added: 40041 | |
2016-07-25 13:53 | c_schmitz | Status | resolved => closed |