Changing first month shown in Date Picker?

More
4 years 1 month 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 or Create an account to join the conversation.

More
4 years 1 month ago - 4 years 1 month 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: 4 years 1 month ago by tpartner.
The following user(s) said Thank You: StuartMark0

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!