Check out the LimeSurvey source code on GitHub!

date question type

More
5 years 4 months ago #66856 by Eddie_V
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

Please Log in to join the conversation.

More
5 years 4 months ago #66859 by Mazi
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)survey-consulting.com'"

Please Log in to join the conversation.

More
5 years 4 months ago #66860 by Eddie_V
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 :)

Please Log in to join the conversation.

More
5 years 4 months ago - 5 years 4 months ago #66862 by Eddie_V
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: 5 years 4 months ago by Eddie_V.

Please Log in to join the conversation.

More
5 years 4 months ago #66863 by Mazi

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)survey-consulting.com'"

Please Log in to join the conversation.

More
5 years 4 months ago #66866 by Eddie_V
done: bugs.limesurvey.org/view.php?id=5496

fyi, your link to the Bugtracker is outdated.

Please Log in to join the conversation.

More
5 years 4 months ago #66869 by Mazi
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)survey-consulting.com'"

Please Log in to join the conversation.

More
5 years 4 months ago #66875 by Eddie_V
your welcome, and thanks to you aswell for your fast replies

Please Log in to join the conversation.

More
5 years 4 months ago #66876 by tpartner
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.

Please Log in to join the conversation.

More
5 years 4 months ago #66879 by Eddie_V
thank you for your suggestion Tony.

But I rather alter the core code instead of adding more code

Please Log in to join the conversation.

More
5 years 4 months ago #66880 by tpartner
But, but, you will be exposed to overwriting when updating...

Cheers,
Tony Partner

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

Please Log in to join the conversation.

More
5 years 4 months ago - 5 years 4 months ago #66881 by Eddie_V
yes true, but adding more and more code will eventually slow down the application.

We have the limeSurvey source in SVN and before an update we run a diff to see what happend to our modifications. And if still necessary they go into the new version. that way not a single one wil be left behind :)
Last Edit: 5 years 4 months ago by Eddie_V.

Please Log in to join the conversation.

More
5 years 4 months ago #66883 by tpartner

yes true, but adding more and more code will eventually slow down the application.

Not in this case. It is client side code that doesn't run until the page is fully loaded. The date picker already requires a ton of JavaScript to work.

Cheers,
Tony Partner

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

Please Log in to join the conversation.

More
5 years 4 months ago #66884 by Eddie_V
still it doesnt feel right to add code to "fix" something else in the code

Please Log in to join the conversation.

More
5 years 4 months ago #66885 by tpartner
That's why jQuery UI allows for dynamic setting of params after initialization - jqueryui.com/demos/datepicker/#option-minDate

Cheers,
Tony Partner

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

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form