Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: date question type

date question type 3 years 1 month ago #66856

  • Eddie_V
  • Eddie_V's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 42
  • Thank you received: 2
  • Karma: 1
I see that whenever I put a dae question into a survey the minimal year is set to 1980 and max is 2020. I can override that by putting my own min/max year into the question settings.

My question is, where can I chance this default 1980 to a different year.

greetings
Eddie_V
The administrator has disabled public write access.

Re: date question type 3 years 1 month ago #66859

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5423
  • Thank you received: 307
  • Karma: 252
I think that is hardcoded at the core files. That's why we offer the ability to change it by setting an according question attribute.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: date question type 3 years 1 month ago #66860

  • Eddie_V
  • Eddie_V's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 42
  • Thank you received: 2
  • Karma: 1
yeah, thats why i wanted to know where in the core files, since I cannot find it. I got a survey with alot of date fields (day of birth to be precise) and I wanted to see if I could chance them all at once.

also it would be nice to just set it to something much earlier then 1980 otherwise I will be getting this question myself by users in the future :)
The administrator has disabled public write access.

Re: date question type 3 years 1 month ago #66862

  • Eddie_V
  • Eddie_V's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 42
  • Thank you received: 2
  • Karma: 1
ok I found it, its in qanda.php and I changed it to 1920 so problem solved. (searching for 1980 into 3605 files took some time :))

But what I did notice is that the default min year was 1980 unless you would set: # Display dropdown boxes to Yes as a question attribute then the default min year is 1900 in the code.

Is there a reason that those 2 have a different min year as default?
Last Edit: 3 years 1 month ago by Eddie_V.
The administrator has disabled public write access.

Re: date question type 3 years 1 month ago #66863

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5423
  • Thank you received: 307
  • Karma: 252
Eddie_V wrote:
But what I did notice is that the default min year was 1980 unless you would set: # Display dropdown boxes to Yes as a question attribute then the default min year is 1900 in the code.

Is there a reason that those 2 have a different min year as default?
Nope, please open a ticket at the bugtracker and...
  1. Give as much information as possible
  2. Attach your survey. You can mark your ticket "private" so that only the developers will be able to take a look at it.
  3. Provide step-by-step instructions how to reproduce the problem.
  4. If possible/helpful please provide screenshots

Afterwards please post the link to the bugtracker so we can follow the progress.

Thanks!

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: date question type 3 years 1 month ago #66866

  • Eddie_V
  • Eddie_V's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 42
  • Thank you received: 2
  • Karma: 1
done: bugs.limesurvey.org/view.php?id=5496

fyi, your link to the bugtracker is outdated.
The administrator has disabled public write access.

Re: date question type 3 years 1 month ago #66869

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5423
  • Thank you received: 307
  • Karma: 252
Thanks for notifying. We'll setup a redirect.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: date question type 3 years 1 month ago #66875

  • Eddie_V
  • Eddie_V's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 42
  • Thank you received: 2
  • Karma: 1
your welcome, and thanks to you aswell for your fast replies
The administrator has disabled public write access.

Re: date question type 3 years 1 month ago #66876

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4364
  • Thank you received: 827
  • Karma: 381
You can use JavaScript to set the minimum (and maximum) date without hacking the core code.

This workaround explains how to do it on a per-question basis - docs.limesurvey.org/tiki-index.php?page_...m_Date_in_Datepicker. With a little modification and placing the code in template.js, it could be used to control all date questions.
	$(document).ready(function() {
 
		$('.popupdate').datepicker( 'option', 'minDate', new Date(1920, 1-1, 1) );
 
	});
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: date question type 3 years 1 month ago #66879

  • Eddie_V
  • Eddie_V's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 42
  • Thank you received: 2
  • Karma: 1
thank you for your suggestion Tony.

But I rather alter the core code instead of adding more code
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.129 seconds
Donation Image