Hi, Is it possible to default the date picker to another month?
I’m talking about the search widget.
I have a special calendar of events and all of my events are only held on Sept and Oct.
So is it also possible to only have Sept & Oct on the calendar grid view?
Please let me know.
Thanks

Mehrdad Emami
Hi Mehrdad,
Yes, but this would involve editing the plug-in files, specifically js/event-search.js
– I should point out that it is the .min.js
version you actually need to edit, but minified files are not fun to edit :), so I’d recommend editing the non-minified one, copying it across (and optionally minifying it again).
The file does nothing else than instantiate the datepicker, and you can use the settings here listed here: http://api.jqueryui.com/datepicker/. I think you need defaultDate option and the minDate and maxDate options.

Stephen Harris
Thanks for the info. I looked at the documentation link and also the following lines of cod in the js file:
data(“range”)?”minDate”:”maxDate”,d=a(this).data(“datepicker”),e=a.datepicker
However I wasn’t able to understand how to change the code to:
$( “.selector” ).datepicker({
defaultDate: +9
});
Could you be more specific please?
Thanks a lot.

Mehrdad Emami
Don’t edit the .min.js
version directly – it would be a nightmare to decipher it. If you open the js/event-search.js
, then you’ll see the .datepicker({...})
call and can just add in your option.

Stephen Harris
It worked! but looks like it doesn’t do exactly what I want.
I added this:
defaultDate: +100
But if I’m understanding correctly it is counting 100 days from today so it is showing Septmeber now. It will be changed every day.
I want to have September as the default start date picker at all times.
Any idea?
Thanks

Mehrdad Emami
That’s correct. You can specify a particular date using a JavaScript date object or a formatted date in the format of the datepicker (e.g. '2015-09-01'
for the 1st September
)

Stephen Harris