View Issue Details

This bug affects 1 person(s).
 22
IDProjectCategoryView StatusLast Update
12258Bug reportsSurvey takingpublic2020-03-13 18:47
Reporterfvanderstarre Assigned Toollehar  
PrioritynoneSeverityminor 
Status closedResolutionreopened 
Product Version2.64.x 
Summary12258: Incorrect date validation when using mm-yyyy dateformat
Description

I set up a survey with a date question using mm-yyyy dateformat. On Friday 31 march, if you select 02-2017, the answer is rejected because day is implicitly set to 31 - and 31-02-2017 is an invalid date.

Steps To Reproduce

See above

Additional Information

To test, you will have to set system date to 31 March, or wait until 29 April (e.g.).

TagsNo tags attached.
Attached Files
mm-yyyy.jpg (26,290 bytes)   
mm-yyyy.jpg (26,290 bytes)   
Bug heat22
Complete LimeSurvey version number (& build)2.64.6+ build 170332
I will donate to the project if issue is resolvedNo
BrowserAny
Database type & versionMS-SQL 2008 R2
Server OS (if known)Linux RHEL 7
Webserver software & version (if known)Apache 2.4.6
PHP Version5.6.30

Relationships

has duplicate 12251 closedollehar Incorrect date validation when using mm-yyyy dateformat 

Users monitoring this issue

fvanderstarre, ollehar

Activities

DenisChenu

DenisChenu

2017-04-06 15:15

developer   ~43388

Maybe we must set to 01 for day and month by default.

And in 2.64 ?

fvanderstarre

fvanderstarre

2017-04-06 15:15

reporter   ~43389

I'll have to test on a separate system. Working on it....

fvanderstarre

fvanderstarre

2017-04-06 15:15

reporter   ~43390

Also in 2.64, see attached screen shot

fvanderstarre

fvanderstarre

2017-04-06 15:15

reporter   ~43391

Should I make a separate report for 2.64 ? Anything to get it fixed..... ;-)

DenisChenu

DenisChenu

2017-04-06 15:15

developer   ~43392

No, not know

  1. In 2.6lts it's not prioritary
  2. Move it to 2.64+ (edit) : someone fix it if able
  3. Make a new report for 2.6lts (and you can put an issue on my 2.6lts fork).
fvanderstarre

fvanderstarre

2017-04-06 15:15

reporter   ~43393

I can't edit anything so will clone it and set to 2.64, thanks!

fvanderstarre

fvanderstarre

2017-04-06 15:18

reporter   ~43395

Related to (= same as) 12251

ollehar

ollehar

2017-04-28 16:56

administrator   ~43501

NB: 31-02-2017 is an invalid date, but PHP will parse it as 2017-03-03 - pushing the date some days ahead, and then the validation fails.

ollehar

ollehar

2017-05-02 15:45

administrator   ~43522

Last edited: 2017-05-02 15:53

Seems like a bug in Date_Time_Converter.

In the _date_to_timestamp() method.

ollehar

ollehar

2017-05-02 16:19

administrator   ~43524

Last edited: 2017-05-02 16:25

Thread on stackoverflow: http://stackoverflow.com/questions/43740037/datetime-converts-wrong-when-system-time-is-30-march?noredirect=1#comment74523192_43740037

Only reproducible when the snippet is put in expression manager! In its own file, the snippet works as expected.

DenisChenu

DenisChenu

2017-05-02 16:53

developer   ~43529

I think it was related to actual date. For example : you ask the day only, and we are on february : if you set 30 or 31 => javascript send 2017-02-31 : date is invalid.

ollehar

ollehar

2017-05-02 17:08

administrator   ~43531

Javascript does not matter. PHP gets the value "02-2017", nothing else. The solution - from the thread - is to use "!" in front of the format.

ollehar

ollehar

2017-05-02 17:27

administrator   ~43532

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

DenisChenu

DenisChenu

2017-05-02 17:28

developer   ~43533

Sorry for bad testing :) thanks to you

ollehar

ollehar

2017-05-03 09:45

administrator   ~43537

Please pull and test.

fvanderstarre

fvanderstarre

2017-05-08 07:43

reporter   ~43578

Olle, you set issue 12251 to resolved, do you still need my feedback on this one? I've been on holiday for two weeks.

fvanderstarre

fvanderstarre

2017-05-29 14:56

reporter   ~43737

It seems to work OK in 2.65.1+170522

ollehar

ollehar

2017-05-31 10:38

administrator   ~43769

Great, I'll mark it as resolved and closed, then.

c_schmitz

c_schmitz

2017-06-07 10:44

administrator   ~43844

https://www.limesurvey.org/forum/installation-a-update-issues/111779-fatal-error-call-to-a-member-function-format-on-boolean-in-var-www-html-lime

c_schmitz

c_schmitz

2020-03-13 18:47

administrator   ~56503

This version of LimeSurvey is not longer supported. Please check so that the issue is fixed in a more recent version of LimeSurvey. If it's not, please reopen this bug report. Thank you.

Related Changesets

LimeSurvey: master ab4c1165

2017-05-02 17:26:37

ollehar

Details Diff
Fixed issue 12258: Incorrect date validation when using mm-yyyy dateformat Affected Issues
12258
mod - application/helpers/expressions/em_manager_helper.php Diff File

Issue History

Date Modified Username Field Change
2017-04-06 15:15 fvanderstarre New Issue
2017-04-06 15:15 fvanderstarre Issue generated from: 12251
2017-04-06 15:15 fvanderstarre Note Added: 43388
2017-04-06 15:15 fvanderstarre Note Added: 43389
2017-04-06 15:15 fvanderstarre Note Added: 43390
2017-04-06 15:15 fvanderstarre Note Added: 43391
2017-04-06 15:15 fvanderstarre Note Added: 43392
2017-04-06 15:15 fvanderstarre Note Added: 43393
2017-04-06 15:18 fvanderstarre Note Added: 43395
2017-04-25 13:02 LouisGac Sticky Issue No => Yes
2017-04-26 12:02 LouisGac Sticky Issue Yes => No
2017-04-28 16:15 ollehar Assigned To => ollehar
2017-04-28 16:15 ollehar Status new => assigned
2017-04-28 16:21 ollehar Assigned To ollehar =>
2017-04-28 16:21 ollehar Assigned To => ollehar
2017-04-28 16:21 ollehar Status assigned => new
2017-04-28 16:21 ollehar Assigned To ollehar =>
2017-04-28 16:56 ollehar Note Added: 43501
2017-04-28 16:56 ollehar Assigned To => ollehar
2017-04-28 16:56 ollehar Status new => assigned
2017-05-02 15:45 ollehar Note Added: 43522
2017-05-02 15:53 ollehar Note Edited: 43522
2017-05-02 16:19 ollehar Note Added: 43524
2017-05-02 16:25 ollehar Note Edited: 43524
2017-05-02 16:53 DenisChenu Note Added: 43529
2017-05-02 17:08 ollehar Note Added: 43531
2017-05-02 17:27 ollehar Changeset attached => LimeSurvey master ab4c1165
2017-05-02 17:27 ollehar Note Added: 43532
2017-05-02 17:27 ollehar Resolution open => fixed
2017-05-02 17:28 DenisChenu Note Added: 43533
2017-05-03 09:45 ollehar Status assigned => feedback
2017-05-03 09:45 ollehar Note Added: 43537
2017-05-04 10:00 ollehar Relationship added has duplicate 12251
2017-05-04 10:00 ollehar Issue Monitored: fvanderstarre
2017-05-04 10:00 ollehar Issue Monitored: ollehar
2017-05-08 07:43 fvanderstarre Note Added: 43578
2017-05-08 07:43 fvanderstarre Status feedback => assigned
2017-05-29 14:56 fvanderstarre Note Added: 43737
2017-05-31 10:38 ollehar Note Added: 43769
2017-05-31 10:38 ollehar Status assigned => closed
2017-06-07 10:44 c_schmitz Note Added: 43844
2017-06-07 10:44 c_schmitz Status closed => feedback
2017-06-07 10:44 c_schmitz Resolution fixed => reopened
2020-03-13 18:47 c_schmitz Note Added: 56503
2020-03-13 18:47 c_schmitz Status feedback => closed