Welcome to the LimeSurvey Community Forum

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

maximum and minimum date requirement doesn't work

  • LISHANGQI
  • LISHANGQI's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 10 months ago - 1 year 10 months ago #228875 by LISHANGQI
    Please help us help you and fill where relevant:
Your LimeSurvey version: [3.28]
Own server or LimeSurvey hosting: Own server 
Survey theme/template: fruity
==================
Dear experts,I get a problem with my date question.  I put {date("Y-m-d",strtotime("today")-60*60*24*30*2)} and {date("Y-m-d",strtotime("today"))}as the minimum and maximum  limit values of the date but when I answer questions with correct date,  the question warned that the inputed date is incorrect.  Maybe it's a bug in the 3.28 version? May I get your help? Thanks in advance! 
Last edit: 1 year 10 months ago by LISHANGQI.

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 10 months ago #228882 by holch
You write Y-m-d in your code, but you show d-m-Y, what is that about?

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Please Log in to join the conversation.

  • LISHANGQI
  • LISHANGQI's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 10 months ago #228884 by LISHANGQI
Hi holch, it seems to depend on my input format, but this is not the reason. I've changed my input format to yyyy-mm-dd but the problem still remains.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 10 months ago - 1 year 10 months ago #228887 by Joffm
1. option:
min date: "-60 days"
max date: "now"

2. option
min date: date("Y-m-d",strtotime('now')-60*60*60*24)
max date: date("Y-m-d",strtotime('now'))

[url] manual.limesurvey.org/Question_type_-_Da..._date_.28date_min.29 [/url]

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 10 months ago by Joffm.
The following user(s) said Thank You: holch

Please Log in to join the conversation.

  • LISHANGQI
  • LISHANGQI's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 10 months ago #228908 by LISHANGQI
Thanks a lot, Joffm, it works now! The problem is caused by using"today" instead of "now".

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose