Combine jQuery-ui datepicker's localization and initialization parameters

jquery, jquery-ui, jquery-ui-datepicker, localization

Solution

`$.datepicker.regional` attribute attribute holds an array of localizations; which themselves are "presets" of the datepicker options. To append your options (overwriting if necessary):

// use $.extend to merge preset options plus your options
$("#datepicker1")
    .datepicker($.extend({}, $.datepicker.regional.fr, {
        beforeShowDay: $.datepicker.noWeekends
    }));

// initialize the datepicker, then use .datepicker("option", options) method twice
$("#datepicker2")
    .datepicker()
    .datepicker("option", $.datepicker.regional.fr)
    .datepicker("option", "beforeShowDay", $.datepicker.noWeekends);

Demo (see example 5)

Problem

I want to have my localized datepicker not allow certain dates picking. Localization: ``` $("#datepicker").datepicker($.datepicker.regional["fr"]); ``` No weekends : ``` $("#datepicker").datepicker({ beforeShowDay: $.datepicker.noWeekends }) ``` I cannot figure out how to combine both?

Original source