Check out the LimeSurvey source code on GitHub!

Changing first month shown in Date Picker?

More
2 years 10 months ago #105975 by StuartMark0
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

Please Log in to join the conversation.

More
2 years 10 months ago - 2 years 10 months ago #105988 by tpartner
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 10 months ago by tpartner.
The following user(s) said Thank You: StuartMark0

Please Log in to join the conversation.

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