View Issue Details

IDProjectCategoryView StatusLast Update
12198Bug reports[All Projects] Survey takingpublic2017-03-21 15:54
Reporterjelo 
Assigned Totestuser_mf 
PrioritynoneSeverityminor 
Status feedbackResolutionfixed 
Product Version2.64.x 
Target VersionFixed in Version 
Summary12198: Date/Time question with timeformat A a for AM/PM is not seen or saved as a valid value
DescriptionDate/Time question with the format set to 'HH:MM A' and the responses are not being captured by LimeSurvey.
Even when a valid entry is made, the response is blank.
This presents a problem with a Mandatory question, because LImesurvey presents an error message even when a valid entry has been made.

Threadstarter is johnF
https://www.limesurvey.org/forum/development/108639-date-time-question-not-caollecting-responses

Issue is reproducible with demo.limesurvey.org.
Changing format from "HH:MM a" to "HH:MMa" didn't make any impact. Nothing saved.
The question type is showing 24 with HH eventhough PM/AM is added. Not sure if that should be changed too.
TagsNo tags attached.
Complete LimeSurvey version number (& build)2.64.Z
I will donate to the project if issue is resolvedNo
Browser
Database & DB-VersionDemo
Operating System (Server)Demo
Webserver software & versionDemo
PHP VersionDemo

Relationships

Activities

jelo

2017-03-14 12:20

reporter  

dateformat_ampm391433.lss (12,732 bytes)

jelo

2017-03-14 12:20

reporter   ~43280

The requested example as a survey file.

DenisChenu

2017-03-18 20:18

developer   ~43291

Strangely : javascript ( {self.NAOK} ) show a good value

DenisChenu

2017-03-18 20:19

developer  

dateformat_ampm391433-withjs.lss (12,775 bytes)

DenisChenu

2017-03-18 20:28

developer   ~43292

Last edited: 2017-03-18 20:32

View 2 revisions

Think it's a boostrap-datepicker issue (see screenshot) BUT : https://github.com/smalot/bootstrap-datetimepicker/issues/3 is closed.

16:00 pm is clearly an invalid date

It's our integration of datetimepicker : https://eonasdan.github.io/bootstrap-datetimepicker/ is OK (see first)



DenisChenu

2017-03-19 18:31

developer   ~43293

https://github.com/LimeSurvey/LimeSurvey/pull/669

DenisChenu

2017-03-19 18:34

developer   ~43294

Last edited: 2017-03-19 18:34

View 2 revisions

You know better momentjs than me. We have to restrict momentjs for php control of date

PHP control is done here : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/expressions/em_manager_helper.php#L8704
And don't accept other momentjs part. And more : using only momentjs broke existing survey.

https://github.com/LimeSurvey/LimeSurvey/pull/669

testuser_mf

2017-03-21 15:54

reporter   ~43307

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

Related Changesets

LimeSurvey: master 81e18b4f

2017-03-19 18:28:51

DenisChenu

Details Diff
Fixed issue 12198: Date/Time question timeformat A seems invalid
Dev: looking at help : d/m/y for date H:M for time, adding A a
Dev: js use momentjs : http://momentjs.com/docs/#/displaying/format/
Dev: but hard to use momentjs with php date
Dev: see http://locutus.io/php/datetime/date/ too
mod - application/helpers/surveytranslator_helper.php Diff File
mod - application/libraries/Date_Time_Converter.php Diff File

LimeSurvey: master fad15807

2017-03-21 15:54:09

testuser_mf


Committer: GitHub Details Diff
Merge pull request #669 from Shnoulle/master_fix12198

Fixed issue 12198: Date/Time question timeformat A seems invalid
mod - application/helpers/surveytranslator_helper.php Diff File
mod - application/libraries/Date_Time_Converter.php Diff File

Issue History

Date Modified Username Field Change
2017-03-12 15:19 jelo New Issue
2017-03-14 12:20 jelo File Added: dateformat_ampm391433.lss
2017-03-14 12:20 jelo Note Added: 43280
2017-03-18 20:18 DenisChenu Note Added: 43291
2017-03-18 20:19 DenisChenu File Added: dateformat_ampm391433-withjs.lss
2017-03-18 20:28 DenisChenu File Added: Capture du 2017-03-18 20-26-12.png
2017-03-18 20:28 DenisChenu Note Added: 43292
2017-03-18 20:32 DenisChenu Note Edited: 43292 View Revisions
2017-03-19 18:31 DenisChenu Note Added: 43293
2017-03-19 18:34 DenisChenu Assigned To => markusfluer
2017-03-19 18:34 DenisChenu Status new => feedback
2017-03-19 18:34 DenisChenu Note Added: 43294
2017-03-19 18:34 DenisChenu Note Edited: 43294 View Revisions
2017-03-21 15:54 DenisChenu Changeset attached => LimeSurvey master 81e18b4f
2017-03-21 15:54 testuser_mf Changeset attached => LimeSurvey master fad15807
2017-03-21 15:54 testuser_mf Note Added: 43307
2017-03-21 15:54 testuser_mf Assigned To markusfluer => testuser_mf
2017-03-21 15:54 testuser_mf Resolution open => fixed