Changing first month shown in Date Picker?

More
3 years 6 months ago #105975 by StuartMark0
StuartMark0 created the topic: Changing first month shown in Date Picker?
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
3 years 6 months ago - 3 years 6 months ago #105988 by tpartner
tpartner replied the topic: Changing first month shown in Date Picker?
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: 3 years 6 months ago by tpartner.
The following user(s) said Thank You: StuartMark0

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now