Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Changing first month shown in Date Picker?

Changing first month shown in Date Picker? 2 years 4 months ago #105975

Hi Guys,

Does anyone know how to change the default month shown in a date picker? We would like it to show February on opening rather than March (the current month).

Cheers,

Mark
The administrator has disabled public write access.

Changing first month shown in Date Picker? 2 years 4 months ago #105988

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6114
  • Thank you received: 1356
  • Karma: 532
You should be able to do that with the jQuery UI Datepicker defaultDate option.

Try adding this to the question source:

<script type="text/javascript" charset="utf-8">	
	$(document).ready(function(){
 
		$('#question{QID} .popupdate').datepicker( 'option', 'defaultDate', new Date(2014, 1, 1) );
 
	});
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 2 years 4 months ago by tpartner.
The administrator has disabled public write access.
The following user(s) said Thank You: StuartMark0
Moderators: ITEd
Time to create page: 0.365 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form