Skip to content

Commit 876aed3

Browse files
fnagelscottgonzalez
authored andcommitted
Datepicker: Make Calendar pass-through options more dynamic
Move calendarOptions variable into datepicker prototype. Ref gh-1432
1 parent 2ea46ae commit 876aed3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ui/datepicker.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@
3131
}
3232
}(function( $ ) {
3333

34-
var widget,
35-
calendarOptions = [ "buttons", "dateFormat", "disabled", "eachDay", "max", "min", "numberOfMonths", "showWeek" ];
36-
37-
widget = $.widget( "ui.datepicker", {
34+
var widget = $.widget( "ui.datepicker", {
3835
version: "@VERSION",
3936
options: {
4037
appendTo: null,
@@ -52,6 +49,9 @@ widget = $.widget( "ui.datepicker", {
5249
select: null
5350
},
5451

52+
calendarOptions: [ "buttons", "dateFormat", "disabled", "eachDay", "max",
53+
"min", "numberOfMonths", "showWeek" ],
54+
5555
_create: function() {
5656
this.suppressExpandOnFocus = false;
5757
this._createCalendar();
@@ -312,7 +312,7 @@ widget = $.widget( "ui.datepicker", {
312312
_setOption: function( key, value ) {
313313
this._super( key, value );
314314

315-
if ( $.inArray( key, calendarOptions ) !== -1 ) {
315+
if ( $.inArray( key, this.calendarOptions ) !== -1 ) {
316316
this.calendarInstance.option( key, value );
317317
}
318318

@@ -341,7 +341,7 @@ widget = $.widget( "ui.datepicker", {
341341
}
342342
});
343343

344-
$.each( calendarOptions, function( index, option ) {
344+
$.each( $.ui.datepicker.prototype.calendarOptions, function( index, option ) {
345345
$.ui.datepicker.prototype.options[ option ] = $.ui.calendar.prototype.options[ option ];
346346
});
347347

0 commit comments

Comments
 (0)