Skip to content

Commit 5d21107

Browse files
committed
Datepicker: Make Calendar pass-through options more dynamic
Move calendarOptions variable into datepicker prototype.
1 parent e21a56d commit 5d21107

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

ui/datepicker.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@
2626
}
2727
}(function( $ ) {
2828

29-
var widget,
30-
calendarOptions = [ "buttons", "dateFormat", "disabled", "eachDay", "max", "min", "numberOfMonths", "showWeek" ];
31-
32-
widget = $.widget( "ui.datepicker", {
29+
var widget = $.widget( "ui.datepicker", {
3330
version: "@VERSION",
3431
options: {
3532
appendTo: null,
@@ -47,6 +44,8 @@ widget = $.widget( "ui.datepicker", {
4744
select: null
4845
},
4946

47+
calendarOptions: [ "buttons", "dateFormat", "disabled", "eachDay", "max", "min", "numberOfMonths", "showWeek" ],
48+
5049
_create: function() {
5150
this.suppressExpandOnFocus = false;
5251
this._createCalendar();
@@ -307,7 +306,7 @@ widget = $.widget( "ui.datepicker", {
307306
_setOption: function( key, value ) {
308307
this._super( key, value );
309308

310-
if ( $.inArray( key, calendarOptions ) !== -1 ) {
309+
if ( $.inArray( key, this.calendarOptions ) !== -1 ) {
311310
this.calendarInstance.option( key, value );
312311
}
313312

@@ -336,7 +335,7 @@ widget = $.widget( "ui.datepicker", {
336335
}
337336
});
338337

339-
$.each( calendarOptions, function( index, option ) {
338+
$.each( $.ui.datepicker.prototype.calendarOptions, function( index, option ) {
340339
$.ui.datepicker.prototype.options[ option ] = $.ui.calendar.prototype.options[ option ];
341340
});
342341

0 commit comments

Comments
 (0)