The LimeSurvey Fund-Raiser 2012 is complete. Thank you for donating a total of 25,000 USD!     List of donors »

Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:
  • Seite:
  • 1

THEMA: Display a question only if today is in a specified date range

Display a question only if today is in a specified date range 3 Monate 1 Woche her #92529

  • brisyb
  • brisybs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 6
  • Karma: 0
I want to display a question only if today falls between a specified date range.

For example, only display question 1. if today is between, or on, 12 march 2013 and 19 march 2013.

Does anyone know how I can do this? maybe in the question source code?
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Display a question only if today is in a specified date range 3 Monate 1 Woche her #92575

  • mfaber
  • mfabers Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 13
  • Karma: 0
Hi Brisib,

function time() will give you the number of seconds passed since 1/1/1970 (the unix euqivalent of today).
function mktime(hour, minutes, seconds, month, day, year) will give you the number of seconds passed between 1/1/1970 and the given date and time.

Now, by entering the following expression in the relevance field of a question, the question will only be shown from february 20, 2013.

(mktime(0,0,0,2,20,2013)>time())

You can of course adjust this to your taste AND similar expressions together etc...
Hope this helps!
Der Administrator hat öffentliche Schreibrechte deaktiviert.
  • Seite:
  • 1
Moderatoren: DenisChenu, ITEd
Ladezeit der Seite: 0.167 Sekunden
Donation Image