Comparing dates

Mehr
7 Monate 6 Tage her - 7 Monate 6 Tage her #173757 von DB1324
COM_KUNENA_MESSAGE_CREATED_NEW
Hi there,


We have a questionnaire which is concerned with a participant's activity over a seven day period.

The participant agrees to take part in our programme, and are enrolled. We create the participant record and token, with an additional attribute 'DateJoined'. This records the date they enrolled, which is likely to be different to the date we added them to LimeSurvey.

We then ask that the participant completes our questionnaire seven days after we enrolled them. We have a field called StartDate, and we need to validate this to ensure it is seven days after DateJoined. We also want to calculate EndDate, which would be six days after StartDate.

Is this possible?


For the EndDate, this works for calculating today's date + 1 week: Week ending: {date('d/m/Y' , time()+604800)} but I can't figure out how to adapt it to reference an existing field.

Any pointers as to how I might (a) validate the StartDate, and/or (b) calculate the EndDate, would be very, very much appreciated.

(We are running Version 2.65.1+170522)

Thank you
Last edit: 7 Monate 6 Tage her by DB1324.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

LimeSurvey Partners
Mehr
7 Monate 6 Tage her - 7 Monate 6 Tage her #173766 von DenisChenu
COM_KUNENA_MESSAGE_REPLIED_NEW
Did you try {strtotime(StartDate)} ?

Something like this : {strtotime("now") > (strtotime(StartDate)+604800)} : to have a boolean

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Last edit: 7 Monate 6 Tage her by DenisChenu.
Folgende Benutzer bedankten sich: DB1324

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
7 Monate 6 Tage her #173771 von DB1324
COM_KUNENA_MESSAGE_REPLIED_NEW
Thanks DenisChenu, a slight addition to that worked:

date('d/m/Y',strtotime(StartDate)+604800)

Thanks again for your help.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha