2012-02-27 00:49:51 +00:00
|
|
|
/*!
|
2008-09-04 22:03:30 +00:00
|
|
|
* jQuery UI Datepicker @VERSION
|
2012-07-04 13:08:08 +00:00
|
|
|
* http://jqueryui.com
|
2008-06-04 02:34:33 +00:00
|
|
|
*
|
2014-12-21 18:27:43 +00:00
|
|
|
* Copyright jQuery Foundation and other contributors
|
2012-08-09 14:13:24 +00:00
|
|
|
* Released under the MIT license.
|
2010-07-09 13:01:04 +00:00
|
|
|
* http://jquery.org/license
|
2008-06-04 02:34:33 +00:00
|
|
|
*/
|
2014-10-30 19:55:08 +00:00
|
|
|
|
|
|
|
//>>label: Datepicker
|
|
|
|
//>>group: Widgets
|
2015-01-29 18:41:42 +00:00
|
|
|
//>>description: Displays a calendar for input-based date selection.
|
2014-10-30 19:55:08 +00:00
|
|
|
//>>docs: http://api.jqueryui.com/datepicker/
|
|
|
|
//>>demos: http://jqueryui.com/datepicker/
|
2015-12-02 17:53:26 +00:00
|
|
|
//>>css.structure: ../../themes/base/core.css
|
|
|
|
//>>css.structure: ../../themes/base/calendar.css
|
|
|
|
//>>css.structure: ../../themes/base/datepicker.css
|
|
|
|
//>>css.theme: ../../themes/base/theme.css
|
2014-10-30 19:55:08 +00:00
|
|
|
|
2015-10-08 13:06:55 +00:00
|
|
|
( function( factory ) {
|
2013-07-12 16:40:48 +00:00
|
|
|
if ( typeof define === "function" && define.amd ) {
|
|
|
|
|
|
|
|
// AMD. Register as an anonymous module.
|
2015-10-08 13:06:55 +00:00
|
|
|
define( [
|
2013-07-12 16:40:48 +00:00
|
|
|
"jquery",
|
2015-07-15 13:40:38 +00:00
|
|
|
"globalize",
|
2014-09-04 18:47:48 +00:00
|
|
|
"globalize/date",
|
2014-06-03 21:18:51 +00:00
|
|
|
"./calendar",
|
2015-08-20 13:48:11 +00:00
|
|
|
"../widget",
|
|
|
|
"../position",
|
2015-07-15 01:58:04 +00:00
|
|
|
"../version",
|
|
|
|
"../keycode"
|
2013-07-12 16:40:48 +00:00
|
|
|
], factory );
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// Browser globals
|
2015-07-15 13:40:38 +00:00
|
|
|
factory( jQuery, Globalize );
|
2013-07-12 16:40:48 +00:00
|
|
|
}
|
2015-10-08 13:06:55 +00:00
|
|
|
}( function( $, Globalize ) {
|
2008-06-04 02:34:33 +00:00
|
|
|
|
2015-01-20 16:43:03 +00:00
|
|
|
var widget = $.widget( "ui.datepicker", {
|
2014-06-03 21:18:51 +00:00
|
|
|
version: "@VERSION",
|
2013-08-26 10:44:20 +00:00
|
|
|
options: {
|
|
|
|
appendTo: null,
|
|
|
|
position: {
|
|
|
|
my: "left top",
|
|
|
|
at: "left bottom"
|
|
|
|
},
|
|
|
|
show: true,
|
|
|
|
hide: true,
|
|
|
|
|
|
|
|
// callbacks
|
2013-08-30 12:27:19 +00:00
|
|
|
beforeOpen: null,
|
2016-05-29 08:57:35 +00:00
|
|
|
change: null,
|
2013-08-26 10:44:20 +00:00
|
|
|
close: null,
|
|
|
|
open: null,
|
|
|
|
select: null
|
|
|
|
},
|
2014-04-23 15:49:03 +00:00
|
|
|
|
2016-04-16 15:01:21 +00:00
|
|
|
calendarOptions: [ "buttons", "classes", "disabled", "dateFormat", "eachDay",
|
2016-04-16 16:47:43 +00:00
|
|
|
"icons", "labels", "locale", "max", "min", "numberOfMonths", "showWeek" ],
|
2015-01-20 16:43:03 +00:00
|
|
|
|
2013-08-26 10:44:20 +00:00
|
|
|
_create: function() {
|
2014-06-18 00:31:31 +00:00
|
|
|
this.suppressExpandOnFocus = false;
|
2016-05-29 00:10:09 +00:00
|
|
|
this._parse = new Globalize( this.options.locale ).dateParser( this.options.dateFormat );
|
2014-09-04 18:47:48 +00:00
|
|
|
|
|
|
|
if ( $.type( this.options.max ) === "string" ) {
|
2016-05-29 00:10:09 +00:00
|
|
|
this.options.max = this._parse( this.options.max );
|
2014-09-04 18:47:48 +00:00
|
|
|
}
|
|
|
|
if ( $.type( this.options.min ) === "string" ) {
|
2016-05-29 00:10:09 +00:00
|
|
|
this.options.min = this._parse( this.options.min );
|
2014-09-04 18:47:48 +00:00
|
|
|
}
|
|
|
|
|
2014-06-03 21:18:51 +00:00
|
|
|
this._createCalendar();
|
2014-06-05 00:39:46 +00:00
|
|
|
|
|
|
|
this._on( this._inputEvents );
|
|
|
|
this._on( this.calendar, this._calendarEvents );
|
|
|
|
this._on( this.document, this._documentEvents );
|
2014-06-03 21:18:51 +00:00
|
|
|
},
|
|
|
|
|
2014-06-04 17:07:23 +00:00
|
|
|
_getCreateOptions: function() {
|
|
|
|
var max = this.element.attr( "max" ),
|
|
|
|
min = this.element.attr( "min" ),
|
2016-10-25 16:27:31 +00:00
|
|
|
parser = function( value ) {
|
|
|
|
var exploded = value.split( "-" );
|
|
|
|
|
|
|
|
return new Date( exploded[ 0 ], exploded[ 1 ] - 1, exploded[ 2 ] );
|
|
|
|
},
|
2014-06-04 17:07:23 +00:00
|
|
|
options = {};
|
|
|
|
|
|
|
|
if ( max !== undefined ) {
|
2016-05-29 00:10:09 +00:00
|
|
|
options.max = parser( max );
|
2014-06-04 17:07:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( min !== undefined ) {
|
2016-05-29 00:10:09 +00:00
|
|
|
options.min = parser( min );
|
2014-06-04 17:07:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return options;
|
|
|
|
},
|
|
|
|
|
2014-06-03 21:18:51 +00:00
|
|
|
_createCalendar: function() {
|
2016-05-29 00:10:09 +00:00
|
|
|
var that = this;
|
2014-06-03 21:18:51 +00:00
|
|
|
|
2016-04-16 15:01:21 +00:00
|
|
|
this.calendar = $( "<div>" ).appendTo( this._appendTo() );
|
|
|
|
this._addClass( this.calendar, "ui-datepicker", "ui-front" );
|
2014-06-03 21:18:51 +00:00
|
|
|
|
|
|
|
// Initialize calendar widget
|
|
|
|
this.calendarInstance = this.calendar
|
2014-06-12 12:36:45 +00:00
|
|
|
.calendar( $.extend( {}, this.options, {
|
2016-05-29 00:10:09 +00:00
|
|
|
value: this._parse( this.element.val() ),
|
2016-05-29 08:57:35 +00:00
|
|
|
change: function( event ) {
|
|
|
|
that._trigger( "change", event );
|
|
|
|
},
|
2014-06-04 21:40:39 +00:00
|
|
|
select: function( event ) {
|
|
|
|
that.element.val( that.calendarInstance.value() );
|
2014-06-03 21:18:51 +00:00
|
|
|
that.close();
|
2015-12-03 15:45:47 +00:00
|
|
|
event.preventDefault();
|
2014-06-03 21:18:51 +00:00
|
|
|
that._focusTrigger();
|
2014-06-04 21:40:39 +00:00
|
|
|
that._trigger( "select", event );
|
2015-12-03 15:45:47 +00:00
|
|
|
|
|
|
|
return false;
|
2012-11-18 20:01:30 +00:00
|
|
|
}
|
2015-10-08 13:06:55 +00:00
|
|
|
} ) )
|
2014-06-03 21:18:51 +00:00
|
|
|
.calendar( "instance" );
|
2014-05-15 22:19:32 +00:00
|
|
|
|
2014-06-19 22:13:20 +00:00
|
|
|
this.calendarInstance.buttonClickContext = that.element[ 0 ];
|
|
|
|
|
2013-08-26 10:44:20 +00:00
|
|
|
this._setHiddenPicker();
|
2015-10-08 13:06:55 +00:00
|
|
|
this.element.attr( {
|
2014-06-18 00:31:31 +00:00
|
|
|
"aria-haspopup": true,
|
|
|
|
"aria-owns": this.calendar.attr( "id" )
|
2015-10-08 13:06:55 +00:00
|
|
|
} );
|
2014-06-05 00:39:46 +00:00
|
|
|
},
|
2013-08-26 10:44:20 +00:00
|
|
|
|
2014-06-05 00:39:46 +00:00
|
|
|
_inputEvents: {
|
|
|
|
keydown: function( event ) {
|
|
|
|
switch ( event.keyCode ) {
|
|
|
|
case $.ui.keyCode.TAB:
|
2015-10-08 13:06:55 +00:00
|
|
|
|
2014-06-05 00:39:46 +00:00
|
|
|
// Waiting for close() will make popup hide too late, which breaks tab key behavior
|
|
|
|
this.calendar.hide();
|
|
|
|
this.close( event );
|
|
|
|
break;
|
|
|
|
case $.ui.keyCode.ESCAPE:
|
2014-05-15 22:19:32 +00:00
|
|
|
if ( this.isOpen ) {
|
2014-06-05 00:39:46 +00:00
|
|
|
this.close( event );
|
2013-08-26 10:44:20 +00:00
|
|
|
}
|
2014-06-05 00:39:46 +00:00
|
|
|
break;
|
2016-04-13 19:54:48 +00:00
|
|
|
case $.ui.keyCode.ENTER:
|
2014-06-05 00:39:46 +00:00
|
|
|
case $.ui.keyCode.DOWN:
|
|
|
|
case $.ui.keyCode.UP:
|
2016-04-13 19:54:48 +00:00
|
|
|
this.open( event );
|
2014-06-05 00:39:46 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
keyup: function() {
|
|
|
|
if ( this.isValid() ) {
|
|
|
|
this.refresh();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mousedown: function( event ) {
|
|
|
|
if ( this.isOpen ) {
|
2014-06-18 00:31:31 +00:00
|
|
|
this.suppressExpandOnFocus = true;
|
2014-06-05 00:39:46 +00:00
|
|
|
this.close();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
this.open( event );
|
|
|
|
clearTimeout( this.closeTimer );
|
|
|
|
},
|
|
|
|
focus: function( event ) {
|
2014-06-18 00:31:31 +00:00
|
|
|
if ( !this.suppressExpandOnFocus && !this.isOpen ) {
|
2013-08-26 10:44:20 +00:00
|
|
|
this._delay( function() {
|
2014-06-18 00:31:31 +00:00
|
|
|
this.open( event );
|
2015-10-08 13:06:55 +00:00
|
|
|
} );
|
2009-12-15 04:00:17 +00:00
|
|
|
}
|
2014-06-05 00:39:46 +00:00
|
|
|
this._delay( function() {
|
2014-06-18 00:31:31 +00:00
|
|
|
this.suppressExpandOnFocus = false;
|
2014-06-05 00:39:46 +00:00
|
|
|
}, 100 );
|
|
|
|
},
|
|
|
|
blur: function() {
|
2014-06-18 00:31:31 +00:00
|
|
|
this.suppressExpandOnFocus = false;
|
2016-05-29 08:57:35 +00:00
|
|
|
},
|
|
|
|
change: function( event ) {
|
|
|
|
this._trigger( "change", event );
|
2014-06-05 00:39:46 +00:00
|
|
|
}
|
|
|
|
},
|
2014-05-15 22:19:32 +00:00
|
|
|
|
2014-06-05 00:39:46 +00:00
|
|
|
_calendarEvents: {
|
|
|
|
focusout: function( event ) {
|
2015-10-08 13:06:55 +00:00
|
|
|
|
2014-06-05 00:39:46 +00:00
|
|
|
// use a timer to allow click to clear it and letting that
|
|
|
|
// handle the closing instead of opening again
|
|
|
|
// also allows tabbing inside the calendar without it closing
|
|
|
|
this.closeTimer = this._delay( function() {
|
|
|
|
this.close( event );
|
|
|
|
}, 150 );
|
|
|
|
},
|
|
|
|
focusin: function() {
|
|
|
|
clearTimeout( this.closeTimer );
|
|
|
|
},
|
|
|
|
mouseup: function() {
|
|
|
|
clearTimeout( this.closeTimer );
|
|
|
|
},
|
2015-10-08 13:06:55 +00:00
|
|
|
|
2015-12-03 15:39:30 +00:00
|
|
|
keydown: function( event ) {
|
2014-06-05 00:39:46 +00:00
|
|
|
if ( event.keyCode === $.ui.keyCode.ESCAPE && this.calendar.is( ":visible" ) ) {
|
|
|
|
this.close( event );
|
|
|
|
this._focusTrigger();
|
2012-11-18 20:01:30 +00:00
|
|
|
}
|
2015-12-03 15:39:30 +00:00
|
|
|
|
|
|
|
if ( event.keyCode === $.ui.keyCode.TAB && this.calendar.is( ":visible" ) ) {
|
|
|
|
var element = $( event.target );
|
|
|
|
|
|
|
|
// Reset focus when leaving widget
|
|
|
|
if (
|
|
|
|
( event.shiftKey && element.is( this.calendarInstance.prevButton ) ) ||
|
|
|
|
( !event.shiftKey && element.is( this.calendarInstance.grid.last() ) )
|
|
|
|
) {
|
|
|
|
this.close( event );
|
|
|
|
this._focusTrigger();
|
|
|
|
}
|
|
|
|
}
|
2014-06-05 00:39:46 +00:00
|
|
|
}
|
|
|
|
},
|
2012-11-18 20:01:30 +00:00
|
|
|
|
2014-06-05 00:39:46 +00:00
|
|
|
_documentEvents: {
|
2014-06-17 14:25:24 +00:00
|
|
|
mousedown: function( event ) {
|
|
|
|
if ( !this.isOpen ) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !$( event.target ).closest( this.element.add( this.calendar ) ).length ) {
|
2014-06-05 00:39:46 +00:00
|
|
|
this.close( event );
|
2008-06-04 02:34:33 +00:00
|
|
|
}
|
2014-06-05 00:39:46 +00:00
|
|
|
}
|
2008-06-04 02:34:33 +00:00
|
|
|
},
|
2014-04-23 15:49:03 +00:00
|
|
|
|
2013-08-26 10:44:20 +00:00
|
|
|
_appendTo: function() {
|
|
|
|
var element = this.options.appendTo;
|
2008-11-18 02:55:25 +00:00
|
|
|
|
2013-08-26 10:44:20 +00:00
|
|
|
if ( element ) {
|
|
|
|
element = element.jquery || element.nodeType ?
|
|
|
|
$( element ) :
|
|
|
|
this.document.find( element ).eq( 0 );
|
2012-11-18 20:01:30 +00:00
|
|
|
}
|
2008-11-18 02:55:25 +00:00
|
|
|
|
2014-06-03 21:18:51 +00:00
|
|
|
if ( !element || !element[ 0 ] ) {
|
2015-04-30 15:38:01 +00:00
|
|
|
element = this.element.closest( ".ui-front, dialog" );
|
2008-12-22 19:18:15 +00:00
|
|
|
}
|
2012-11-18 20:01:30 +00:00
|
|
|
|
2013-08-26 10:44:20 +00:00
|
|
|
if ( !element.length ) {
|
2014-04-23 15:49:03 +00:00
|
|
|
element = this.document[ 0 ].body;
|
2008-07-06 05:31:06 +00:00
|
|
|
}
|
2012-11-18 20:01:30 +00:00
|
|
|
|
2013-08-26 10:44:20 +00:00
|
|
|
return element;
|
2008-06-04 02:34:33 +00:00
|
|
|
},
|
2014-05-15 22:19:32 +00:00
|
|
|
|
2013-08-26 10:44:20 +00:00
|
|
|
_focusTrigger: function() {
|
2014-06-18 00:31:31 +00:00
|
|
|
this.suppressExpandOnFocus = true;
|
2013-08-26 10:44:20 +00:00
|
|
|
this.element.focus();
|
2008-06-04 02:34:33 +00:00
|
|
|
},
|
2014-04-23 15:49:03 +00:00
|
|
|
|
2013-08-26 10:44:20 +00:00
|
|
|
refresh: function() {
|
2014-06-03 21:18:51 +00:00
|
|
|
this.calendarInstance.option( "value", this._getParsedValue() );
|
2008-06-04 02:34:33 +00:00
|
|
|
},
|
2014-04-23 15:49:03 +00:00
|
|
|
|
2013-08-26 10:44:20 +00:00
|
|
|
open: function( event ) {
|
2014-06-03 21:18:51 +00:00
|
|
|
if ( this.isOpen ) {
|
2013-08-26 10:44:20 +00:00
|
|
|
return;
|
2012-11-18 20:01:30 +00:00
|
|
|
}
|
2013-08-30 12:27:19 +00:00
|
|
|
if ( this._trigger( "beforeOpen", event ) === false ) {
|
|
|
|
return;
|
|
|
|
}
|
2012-11-18 20:01:30 +00:00
|
|
|
|
2014-06-03 21:18:51 +00:00
|
|
|
this.calendarInstance.refresh();
|
|
|
|
this.calendar
|
2015-10-08 13:06:55 +00:00
|
|
|
.attr( {
|
2014-06-18 00:31:31 +00:00
|
|
|
"aria-hidden": false,
|
|
|
|
"aria-expanded": true
|
2015-10-08 13:06:55 +00:00
|
|
|
} )
|
2013-08-26 10:44:20 +00:00
|
|
|
.show()
|
2013-11-18 14:23:15 +00:00
|
|
|
.position( this._buildPosition() )
|
2013-08-26 10:44:20 +00:00
|
|
|
.hide();
|
2014-06-03 21:18:51 +00:00
|
|
|
this._show( this.calendar, this.options.show );
|
2012-11-18 20:01:30 +00:00
|
|
|
|
2013-08-26 10:44:20 +00:00
|
|
|
this.isOpen = true;
|
|
|
|
this._trigger( "open", event );
|
2016-04-13 19:54:48 +00:00
|
|
|
|
|
|
|
this._delay( function() {
|
|
|
|
this.calendarInstance.grid.focus();
|
|
|
|
} );
|
2009-04-10 08:04:57 +00:00
|
|
|
},
|
2014-04-23 15:49:03 +00:00
|
|
|
|
2013-08-26 10:44:20 +00:00
|
|
|
close: function( event ) {
|
|
|
|
this._setHiddenPicker();
|
2014-06-03 21:18:51 +00:00
|
|
|
this._hide( this.calendar, this.options.hide );
|
2008-11-18 02:55:25 +00:00
|
|
|
|
2013-08-26 10:44:20 +00:00
|
|
|
this.isOpen = false;
|
|
|
|
this._trigger( "close", event );
|
2008-06-04 02:34:33 +00:00
|
|
|
},
|
2014-04-23 15:49:03 +00:00
|
|
|
|
2013-08-26 10:44:20 +00:00
|
|
|
_setHiddenPicker: function() {
|
2015-10-08 13:06:55 +00:00
|
|
|
this.calendar.attr( {
|
2014-06-18 00:31:31 +00:00
|
|
|
"aria-hidden": true,
|
|
|
|
"aria-expanded": false
|
2015-10-08 13:06:55 +00:00
|
|
|
} );
|
2008-06-04 02:34:33 +00:00
|
|
|
},
|
2014-04-23 15:49:03 +00:00
|
|
|
|
2013-11-18 14:23:15 +00:00
|
|
|
_buildPosition: function() {
|
2014-05-15 22:19:32 +00:00
|
|
|
return $.extend( { of: this.element }, this.options.position );
|
2013-11-18 14:23:15 +00:00
|
|
|
},
|
2014-04-23 15:49:03 +00:00
|
|
|
|
2013-11-21 14:03:08 +00:00
|
|
|
value: function( value ) {
|
|
|
|
if ( arguments.length ) {
|
2016-05-29 00:10:09 +00:00
|
|
|
this.valueAsDate( this._parse( value ) );
|
2014-06-03 21:18:51 +00:00
|
|
|
} else {
|
|
|
|
return this._getParsedValue() ? this.element.val() : null;
|
2013-11-21 14:03:08 +00:00
|
|
|
}
|
|
|
|
},
|
2014-04-23 15:49:03 +00:00
|
|
|
|
2013-11-21 14:03:08 +00:00
|
|
|
valueAsDate: function( value ) {
|
|
|
|
if ( arguments.length ) {
|
2014-06-04 17:07:23 +00:00
|
|
|
if ( this.calendarInstance._isValid( value ) ) {
|
2014-06-03 21:18:51 +00:00
|
|
|
this.calendarInstance.valueAsDate( value );
|
2015-07-28 21:10:16 +00:00
|
|
|
this.element.val( this.calendarInstance._format( value ) );
|
2014-06-03 21:18:51 +00:00
|
|
|
}
|
2013-11-21 14:03:08 +00:00
|
|
|
} else {
|
2014-06-03 21:18:51 +00:00
|
|
|
return this._getParsedValue();
|
2013-11-21 14:03:08 +00:00
|
|
|
}
|
|
|
|
},
|
2014-04-23 15:49:03 +00:00
|
|
|
|
2014-01-03 14:07:38 +00:00
|
|
|
isValid: function() {
|
2014-06-04 17:07:23 +00:00
|
|
|
return this.calendarInstance._isValid( this._getParsedValue() );
|
2014-01-03 14:07:38 +00:00
|
|
|
},
|
2014-04-23 15:49:03 +00:00
|
|
|
|
2013-08-26 10:44:20 +00:00
|
|
|
_destroy: function() {
|
2014-06-03 21:18:51 +00:00
|
|
|
this.calendarInstance.destroy();
|
|
|
|
this.calendar.remove();
|
2014-06-18 00:31:31 +00:00
|
|
|
this.element.removeAttr( "aria-haspopup aria-owns" );
|
2013-08-26 10:44:20 +00:00
|
|
|
},
|
2014-04-23 15:49:03 +00:00
|
|
|
|
2013-08-26 10:44:20 +00:00
|
|
|
widget: function() {
|
2014-06-03 21:18:51 +00:00
|
|
|
return this.calendar;
|
2013-11-15 13:42:20 +00:00
|
|
|
},
|
2014-04-23 15:49:03 +00:00
|
|
|
|
2014-05-15 22:19:32 +00:00
|
|
|
_getParsedValue: function() {
|
2016-05-29 00:10:09 +00:00
|
|
|
return this._parse( this.element.val() );
|
2014-05-15 22:19:32 +00:00
|
|
|
},
|
|
|
|
|
2013-11-15 13:42:20 +00:00
|
|
|
_setOption: function( key, value ) {
|
2016-05-29 00:10:09 +00:00
|
|
|
if ( key === "max" || key === "min" ) {
|
|
|
|
if ( typeof value === "string" ) {
|
|
|
|
value = this._parse( value );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-15 13:42:20 +00:00
|
|
|
this._super( key, value );
|
|
|
|
|
2015-01-20 16:43:03 +00:00
|
|
|
if ( $.inArray( key, this.calendarOptions ) !== -1 ) {
|
2014-06-03 21:18:51 +00:00
|
|
|
this.calendarInstance.option( key, value );
|
2013-11-15 13:42:20 +00:00
|
|
|
}
|
2013-11-15 14:17:13 +00:00
|
|
|
|
2014-06-03 21:18:51 +00:00
|
|
|
if ( key === "appendTo" ) {
|
|
|
|
this.calendar.appendTo( this._appendTo() );
|
2013-11-19 13:35:19 +00:00
|
|
|
}
|
|
|
|
|
2015-07-28 21:10:16 +00:00
|
|
|
if ( key === "locale" || key === "dateFormat" ) {
|
2014-06-03 21:18:51 +00:00
|
|
|
this.element.val( this.calendarInstance.value() );
|
2013-11-15 14:17:13 +00:00
|
|
|
}
|
2013-11-18 14:23:15 +00:00
|
|
|
|
2014-09-01 13:36:38 +00:00
|
|
|
if ( key === "disabled" ) {
|
|
|
|
this.element
|
|
|
|
.prop( "disabled", value )
|
|
|
|
.toggleClass( "ui-state-disabled", value )
|
|
|
|
.attr( "aria-disabled", value );
|
|
|
|
|
|
|
|
if ( value ) {
|
|
|
|
this.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-18 14:23:15 +00:00
|
|
|
if ( key === "position" ) {
|
2014-06-03 21:18:51 +00:00
|
|
|
this.calendar.position( this._buildPosition() );
|
2013-11-18 14:23:15 +00:00
|
|
|
}
|
2008-06-04 02:34:33 +00:00
|
|
|
}
|
2015-10-08 13:06:55 +00:00
|
|
|
} );
|
2014-06-18 00:31:31 +00:00
|
|
|
|
2015-01-20 16:43:03 +00:00
|
|
|
$.each( $.ui.datepicker.prototype.calendarOptions, function( index, option ) {
|
2014-06-12 12:36:45 +00:00
|
|
|
$.ui.datepicker.prototype.options[ option ] = $.ui.calendar.prototype.options[ option ];
|
2015-10-08 13:06:55 +00:00
|
|
|
} );
|
2014-06-12 12:36:45 +00:00
|
|
|
|
|
|
|
return widget;
|
|
|
|
|
2015-10-08 13:06:55 +00:00
|
|
|
} ) );
|