View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
03800Bug reportsSurvey takingpublic2009-11-28 13:45
Reporterbkgray Assigned Toc_schmitz  
PrioritynormalSeveritypartial_block 
Status closedResolutionfixed 
Product Version1.86 
Fixed in Version1.87RC3 
Summary03800: Condition comparison of dates fails
Description

A condition that compares a date entered in a previous question to a date constant or date entered in a token field does not work as expected.

The survey's date format is yyyy/mm/dd. When I display the precious answer in the body of a subsequent question, it is displayed with format dd.mm.yyyy

Conditional comparisons for "less than" and "equals" do not work. I have not tested others.

The conditions worked as expected in most recent 1.85+.

Additional Information

See the sample survey file attached.

TagsNo tags attached.
Attached Files
Bug heat10
Complete LimeSurvey version number (& build)7697
I will donate to the project if issue is resolved
BrowserFF, IE
Database type & versionMySql
Server OS (if known)Win 2K3,
Webserver software & version (if known)Apache
PHP Version5.1.4

Users monitoring this issue

bkgray

Activities

user372

2009-10-28 16:38

  ~09896

I get the following notices, if I run the attached survey:
Notice: Undefined variable: thistype in /home/.sites/962/site989/web/limesurvey/common.php on line 6142

Notice: Undefined variable: thistype in /home/.sites/962/site989/web/limesurvey/common.php on line 6142

Notice: Undefined variable: cq_gid in /home/.sites/962/site989/web/limesurvey/common.php on line 6158

Notice: Undefined variable: cq_gid in /home/.sites/962/site989/web/limesurvey/common.php on line 6286

lemeur

lemeur

2009-10-28 22:06

developer   ~09908

This is no bug, you juste have to use YYY-MM-DD format as the constant value because conditions are independant on the date-format defined in a specific language of a survey.

I've updated Documentation.
http://docs.limesurvey.org/tiki-index.php?page=Setting+conditions+v1.85#Setting_a_constant_comparison_value_for_a_quot_Date_quot_Question_Type

bkgray

bkgray

2009-10-28 22:55

reporter   ~09910

Thanks, lemeur. I changed the date constants to the correct format and it fixed the problem. Oddly, if I display the value of the entered date in the text of a subsequent question (using INSERTANS), the date is displayed as dd.mm.yyyy.

Also, in the survey I uploaded (with the date constant modified to the correct format) and with $debug = 1, I still get the four undefined variable error messages in one case on question code q4.

The condition on q4 is <date> not equal to 2009-10-28. If I enter another date in the previous question, the condition is triggered and I get the appropriate message, but the screen also shows the four error message.

Thanks for the quick answer!

bkg

lemeur

lemeur

2009-10-28 23:04

developer   ~09911

the error message you see is because your survey structure contains a strange condition for question q4: it has cqid field set to '0' which is not normal...

Juste delete the condition and create it again, this should fix the issue.

lemeur

lemeur

2009-10-28 23:33

developer   ~09912

Carsten, I assign this one to you: the remaining issue is about the format used to display INSERTANS: answers corresponding to date questions.

It seems that the getextendedanswer() function in common.php always returns a d.m.Y date format

getextendedanswer($fieldcode, $value, $format='', $dateformatphp='d.m.Y')
...

line 2047:
$datetimeobj = new Date_Time_Converter($value , "Y-m-d H:i:s");
$value=$datetimeobj->convert($dateformatphp);

Do you think we should change this ?

c_schmitz

c_schmitz

2009-11-22 20:19

administrator   ~10207

Fixed remaining issues with INSERTANS

Issue History

Date Modified Username Field Change
2009-10-28 14:50 bkgray New Issue
2009-10-28 14:50 bkgray Status new => assigned
2009-10-28 14:50 bkgray Assigned To => user372
2009-10-28 14:50 bkgray File Added: limesurvey_survey_73529.csv
2009-10-28 14:50 bkgray LimeSurvey build number => 7697
2009-10-28 14:50 bkgray Browser => FF, IE
2009-10-28 14:50 bkgray Database & DB-Version => MySql
2009-10-28 14:50 bkgray Operating System (Server) => Win 2K3,
2009-10-28 14:50 bkgray Webserver => Apache
2009-10-28 14:50 bkgray PHP Version => 5.1.4
2009-10-28 14:54 bkgray Issue Monitored: bkgray
2009-10-28 16:38 user372 Note Added: 09896
2009-10-28 16:38 user372 Assigned To user372 => lemeur
2009-10-28 22:06 lemeur Note Added: 09908
2009-10-28 22:55 bkgray Note Added: 09910
2009-10-28 23:04 lemeur Note Added: 09911
2009-10-28 23:31 lemeur Assigned To lemeur => c_schmitz
2009-10-28 23:33 lemeur Note Added: 09912
2009-11-22 20:19 c_schmitz Note Added: 10207
2009-11-22 20:19 c_schmitz Status assigned => resolved
2009-11-22 20:19 c_schmitz Fixed in Version => 1.87RC3
2009-11-22 20:19 c_schmitz Resolution open => fixed
2009-11-28 13:45 c_schmitz Status resolved => closed
2010-10-25 00:18 c_schmitz Category Survey at Runtime => Survey taking
2021-09-17 03:32 guest Bug heat 8 => 10