View Issue Details

This issue affects 1 person(s).
 12
IDProjectCategoryView StatusLast Update
07792Bug reportsSurvey takingpublic2013-04-24 11:06
Reporterandrewb Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionno change required 
Product Version2.00+ 
Summary07792: Date/Time Questions not supporting/recording 'i' type minutes with dropdown boxes
Description

I have an issue where on a survey I have a question type of "Date/Time" set to H:i and the i part wasn't being recorded by the survey. Further investigation found that it was only setting the "H" part of the answer and not the "i".

Eg when selecting: 16:30 the resulting answer becomes: 16:i instead of 16:30.

I have discovered the issue lies within the
/scripts/date.js

The way I got it to work is outlined below under "Additional Information".

Steps To Reproduce

First setup a question like:
Type: Date/Time
Display dropdown boxes: Yes
Minute step interval: 30
Date/Time format: H:i

Run the survey.

Additional Information

My workaround (I have only been coding in JavaScript/Jquery for a couple of weeks now, so this might not be the best solution).

Line 120-123 of /scripts/date.js

have the following:
parseddate=parseddate.replace('HH',pad(iHour,2));
parseddate=parseddate.replace('H',iHour);
parseddate=parseddate.replace('NN',pad(iMinute,2));
parseddate=parseddate.replace('N',iMinute);

After tracking through with Firebug I found that the "i" in the variable was never replaced.
I fixed this by inserting a line at the end with:

       parseddate=parseddate.replace('i',pad(iMinute,2)); 

I have not tested this any futher other than I know that it is now working for me. I don't see that it will have any major sideeffects given it will only effect the parseddate variable when the 'i' is present.

TagsNo tags attached.
Bug heat12
Complete LimeSurvey version number (& build)130406
I will donate to the project if issue is resolvedNo
BrowserFirefox
Database type & versionMySQL
Server OS (if known)Linux
Webserver software & version (if known)Litespeed Server
PHP Version5.3
Git branch / Pull Request URL

Relationships

has duplicate 07791 closedc_schmitz Issues with rendering Time questions with Date/Time Question Type 

Users monitoring this issue

mfaber

Activities

c_schmitz

c_schmitz

2013-04-24 11:06

administrator   ~25110

'i' isn't a valid variable for minutes, 'M' and 'MM' is as the hint on the detailed question settings says.

Issue History

Date Modified Username Field Change
2013-04-23 10:43 andrewb New Issue
2013-04-23 11:25 mfaber Issue Monitored: mfaber
2013-04-24 11:06 c_schmitz Note Added: 25110
2013-04-24 11:06 c_schmitz Status new => closed
2013-04-24 11:06 c_schmitz Assigned To => c_schmitz
2013-04-24 11:06 c_schmitz Resolution open => no change required
2013-04-24 11:06 c_schmitz Relationship added has duplicate 07791