Question in (current) date format

More
2 years 10 months ago #142692 by hanwerts
I want to program a question in date format in which I want to know when the user started a course. This in itself is an easy task. I use the drop down option in which the user can enter the full date or select day, month and year from a calendar.

I would like to compare the input from the user to a predefined date. The latter one is dynamic, i.e. it should be the current date, so it will change every day. I came up with the idea that the current date will be set using a hidden question which precedes the date question presented to the user.

How can I set the current date in a hidden question and use it in the next date question? And how can I validate that the input from the user will be in the past (i.e. lower than current date from the hidden question)?

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
2 years 10 months ago #142696 by jelo

hanwerts wrote: How can I set the current date in a hidden question and use it in the next date question?

{date('Y-m-d')} should work in a equation question.

You might calculate differences in e.g days and compare them.
www.limesurvey-consulting.com/how-to-cal...nd-the-current-date/

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!