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

TOPIC: date question type

date question type 4 years 1 month ago #66886

  • Eddie_V
  • Eddie_V's Avatar
  • Offline
  • Senior Lime
  • Posts: 42
  • Thank you received: 2
  • Karma: 1
it didn't redirect me corretly but I found what you ment.

one question tho, what would happen if a user in limesurvey would set a min date in the attributes, would that still override the date I set in the template.js?

I dont have the source code here at home, so I cannot do a quick test, but if it still works that way I will try/implement your suggestion.
The administrator has disabled public write access.

date question type 4 years 1 month ago #66933

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5274
  • Thank you received: 1100
  • Karma: 458
Well, it turns out that my fix does take precedence over the advanced settings so we need a test to see if the admin set those.

This script will set a new minimum and maximum year for all date questions that do not have the "Minimum year" or "Maximum year" advanced settings changed.
<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
			var newMinYear = 1920;
			var newMaxYear = 2030;
				var qYearRange = $('input[id^="dateyearrange"]', this).val();
				if(qYearRange == '1980:2020') {
					$('.popupdate', this).datepicker( 'option', "yearRange", ''+newMinYear+':'+newMaxYear+'' );
					$('.popupdate', this).datepicker( 'option', 'minDate', new Date(newMinYear, 1-1, 1) );
					$('.popupdate', this).datepicker( 'option', 'maxDate', new Date(newMaxYear, 1-1, 1) );
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.
Last Edit: 4 years 1 month ago by tpartner.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.208 seconds