Comparing dates

Mehr
1 Woche 2 Tage her - 1 Woche 2 Tage her #173757 von DB1324
DB1324 erstellte das Thema Comparing dates
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
Letzte Änderung: 1 Woche 2 Tage her von DB1324.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
1 Woche 2 Tage her - 1 Woche 2 Tage her #173766 von DenisChenu
DenisChenu antwortete auf das Thema: Comparing dates
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 .
Letzte Änderung: 1 Woche 2 Tage her von DenisChenu.
Folgende Benutzer bedankten sich: DB1324

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
1 Woche 2 Tage her #173771 von DB1324
DB1324 antwortete auf das Thema: Comparing dates
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