View Issue Details

This bug affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
20017Bug reportsSurvey takingpublic2025-04-23 23:01
Reportersamarta Assigned ToDenisChenu  
PrioritynoneSeveritypartial_block 
Status ready for code reviewResolutionopen 
Product Version6.6.x 
Summary20017: Error selecting the first possible date in the calendar
Description

This error occurs when, in a question of the date type, a relative minimum value is set for the date to be entered.
For example: ‘+6days’
When answering the questionnaire, if we choose the first day that can be selected, when we submit the questionnaire a popup window appears with the error:

"One or more questions have not been answered in a valid manner. You cannot proceed until these answers are valid."

Steps To Reproduce

1 - make a survey with one question of type date/time

2 - Insert "+6days" on Minimum date configuration of the question Display section

3- Answer the survey and choose the first available date of the calendar

Expected result

Submission successful

Actual result

popup window appears with the error:

"One or more questions have not been answered in a valid manner. You cannot proceed until these answers are valid."

(Write here what happened instead)

TagsNo tags attached.
Bug heat2
Complete LimeSurvey version number (& build)LimeSurvey Community Edition Version 6.12.0+250310
I will donate to the project if issue is resolvedNo
BrowserSafari, Chrome
Database type & versionmysqlnd 7.4.21
Server OS (if known)
Webserver software & version (if known)Apache/2.4.37 (centos)
PHP Version7.4.21

Users monitoring this issue

There are no users monitoring this issue.

Activities

gabrieljenik

gabrieljenik

2025-04-23 22:59

manager   ~82474

If the input format does not include a time, the minimum date should either not include a time or be 00:00.

If this does not occur, and the minimum date has a time (Ex: 2025-04-29 15:30):

  • The date selected by the date picker will be 00:00 (Ex: 2025-04-29 00:00).
  • The minimum date will have a later time (Ex: 2025-04-29 15:30).
    Due to the implementation of the date picker, it will allow 2025-04-29 to be selected, but validation will fail.

An expression in the minimum date, such as "+6 days," resolves to a date that has a time, such as 2025-04-29 15:30.

To solve this problem, a more complex expression must be used: date("Y-m-d", strtotime("+6 days")).

This doesn't happen with maximum date validation, since a date with a time of 00:00 will always be less than or equal to the date resulting from the "+6 days" expression.


I will include a comment in the code to help in case this kind of questions appear again in the future.

gabrieljenik

gabrieljenik

2025-04-23 23:01

manager   ~82475

The question is, should we validate to avoid this kind of situtations in the future? Worth it?
Ex: If the min date has a time, and the date picker don't, trim the min date, as to compare equals.

Issue History

Date Modified Username Field Change
2025-03-18 12:47 samarta New Issue
2025-04-07 16:55 tibor.pacalat Assigned To => gabrieljenik
2025-04-07 16:55 tibor.pacalat Status new => assigned
2025-04-23 22:59 gabrieljenik Note Added: 82474
2025-04-23 22:59 gabrieljenik Bug heat 0 => 2
2025-04-23 22:59 gabrieljenik Assigned To gabrieljenik => DenisChenu
2025-04-23 22:59 gabrieljenik Status assigned => ready for code review
2025-04-23 23:01 gabrieljenik Note Added: 82475