I want to customize a jQuery datapicker in Drupal 7. I found code to set an event:
(function ($) {
Drupal.behaviors.only_monday = {
attach: function (context, settings) {
// $( ".selector" ).datepicker( "option", "showWeek", true );
$.datepicker._defaults.beforeShowDay = onlyMonday;
function onlyMonday ( date ) {
if ( date.getDay() == 1 ) {
return [true, 'ui-datepicker-days-cell'];
}
else {
return [false, 'ui.datepicker-unselectable'];
}
}
}
};
}(jQuery));
This works great, except for commented line. According to the jQuery docs that line (added by myself) should make visible the numbers of the weeks:
$( ".selector" ).datepicker( "option", "showWeek", true );
The context from within Drupal is probably different. But I have no knowledge of js :-(
In what way does this code for setting an option has to be adjusted ?