View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
11417Bug reportsExpression Managerpublic2016-07-25 13:53
ReporterIsaac007 Assigned Tomarkusfluer 
PriorityurgentSeverityminor 
Status closedResolutionfixed 
Product Version2.50.x 
Fixed in Version2.50.x 
Summary11417: 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))}

TagsNo tags attached.
Attached Files
LimeSurveyBug.zip (42,219 bytes)
Bug heat8
Complete LimeSurvey version number (& build)160506
I will donate to the project if issue is resolvedYes
BrowserSafari V9.1.1
Database type & versionMariaDB 5.5.49
Server OS (if known)Linux Diskstation
Webserver software & version (if known)Apache HTTP server 5.2
PHP Version5.6.21

Users monitoring this issue

There are no users monitoring this issue.

Activities

LouisGac

LouisGac

2016-06-27 11:14

developer   ~39802

First note:

It's working with drop down date, so it's probably related to the new date picker.

frederikprijck

frederikprijck

2016-06-27 19:51

reporter   ~39804

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 ?

markusfluer

markusfluer

2016-07-22 12:11

administrator   ~40020

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

c_schmitz

c_schmitz

2016-07-25 13:53

administrator   ~40041

Version 2.50+ Build 160725 released

Related Changesets

LimeSurvey: master 349e0088

2016-07-22 10:05:04

markusfluer

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

Issue History

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 LouisGac Sticky Issue No => Yes
2016-06-27 11:14 LouisGac Note Added: 39802
2016-06-27 14:36 LouisGac View Status private => public
2016-06-27 19:51 frederikprijck Note Added: 39804
2016-07-15 12:32 LouisGac Sticky Issue Yes => No
2016-07-15 14:49 c_schmitz Priority none => urgent
2016-07-19 10:58 markusfluer Assigned To => markusfluer
2016-07-19 10:58 markusfluer Status new => assigned
2016-07-19 10:59 markusfluer Assigned To markusfluer =>
2016-07-19 10:59 markusfluer Status assigned => new
2016-07-19 11:15 markusfluer Assigned To => markusfluer
2016-07-19 11:15 markusfluer Status new => assigned
2016-07-22 12:11 markusfluer Changeset attached => LimeSurvey master 349e0088
2016-07-22 12:11 markusfluer Note Added: 40020
2016-07-22 12:11 markusfluer Resolution open => fixed
2016-07-22 12:40 markusfluer Status assigned => resolved
2016-07-22 12:40 markusfluer 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