Welcome, Guest
Username: Password: Remember me

TOPIC: Changing first month shown in Date Picker?

Changing first month shown in Date Picker? 7 months 2 weeks 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? 7 months 2 weeks ago #105988

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4264
  • Thank you received: 801
  • Karma: 368
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 7 months 2 weeks 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.093 seconds
Donation Image