Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Array of Dates in Limesurvey 3.x

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 1 week ago #215158 by Joffm
Replied by Joffm on topic Array of Dates in Limesurvey 3.x
Hi,
why don't you use the built-in questioin type "date/time"?
Here all your requirements are built-in

For the first start date (Q1a) set a Mindate of "date(Y-m-d)"
For the first end date (Q1b) set Mindate to the value of Q1a

2. Period:
start date: Mindate=Q1b
end date: Mindate=Q2a
...

   

To join the questions a used the css class "no-bottom".
Put this into your "custom.css" and add the css class "no-bottom" to the first of the two questions
Code:
.no-bottom{border-bottom:0;margin-bottom:0;}
.no-bottom .answer-container {padding-bottom: 0em;}

Just an idea.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 1 week ago #215159 by Joffm
Replied by Joffm on topic Array of Dates in Limesurvey 3.x
And as you read here
[url] manual.limesurvey.org/Question_type_-_Da..._date_.28date_min.29 [/url]

you can use certain strings or calculation to fine tune the allowed date rangeValid values
  • Any date value in format YYYY-MM-DD (eg., 2017-08-24);
  • Any year value;
  • Any English string  : "now", "-10 years", "tomorrow";
  • Reference to another date/time question : AnotherDateQuestion (using the question code);
  • Expressions : With expressions, a minimum date can be dynamically calculated. For example, you can use a date from a previous answer + 3 days as a minimum for the present question by entering: date("Y-m-d",strtotime(departuredate)+3*60*60*24).
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
2 years 11 months ago #215484 by mihai.bejan
Replied by mihai.bejan on topic Array of Dates in Limesurvey 3.x
Hi Joffm,

Thank very much for your time!
In the end I quit using a date range picker and I decided to go with an Array question. For the statistic it's better this way.

Everything is going pretty smooth, but still I have a problem with Question validation equation. As you can see in the attached survey I want to use 4 tokens, so that each participant will have it's own values.

But let's just focus on first 2 tokens. The first token is a minimum value and the second token is the maximum value that will be mandatory for each participant. The idea is that the sum of responses on the first column to be bigger or equal with min value and smaller or equal with the max value.

For example if the min value will be 2 and the max value will be 32 and if I select only 4 answers on the first column, the question will be in "red" because for some reasons it will compare only with the first digit from the max value; 4 <= 3. The only time the question will be in "green" is when he sum is equal with 2, 3 and from 20 to 32.

If I use for example min value 4 and max value 21 it will be even worse.

If in the Question validation equation I use numbers instead of tokens, it will work fine.

Please, if you encounter this situation in the past can you show the right way. It's not excluded that I use the wrong equation.

Thank you in advance!

Bets regards!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose