jquery-src/jquery.calendars.picker.js
function(elem, inst) {
			elem.off('focus.' + inst.name);
			if (inst.options.showOnFocus) {
				elem.on('focus.' + inst.name, this.show);
			}
			if (inst.trigger) {
				inst.trigger.remove();
			}
			var trigger = inst.options.showTrigger;
			inst.trigger = (!trigger ? $([]) :
				$(trigger).clone().removeAttr('id').addClass(this._triggerClass)
					[inst.options.isRTL ? 'insertBefore' : 'insertAfter'](elem).
					click(function() {
						if (!plugin.isDisabled(elem[0])) {
							plugin[plugin.curInst === inst ? 'hide' : 'show'](elem[0]);
						}
					}));
			this._autoSize(elem, inst);
			var dates = this._extractDates(inst, elem.val());
			if (dates) {
				this.setDate(elem[0], dates, null, true);
			}
			var defaultDate = inst.get('defaultDate');
			if (inst.options.selectDefaultDate && defaultDate && inst.selectedDates.length === 0) {
				this.setDate(elem[0], (defaultDate || inst.options.calendar.today()).newDate());
			}
		}
function(elem, inst) {
			elem.off('focus.' + inst.name);
			if (inst.options.showOnFocus) {
				elem.on('focus.' + inst.name, this.show);
			}
			if (inst.trigger) {
				inst.trigger.remove();
			}
			var trigger = inst.options.showTrigger;
			inst.trigger = (!trigger ? $([]) :
				$(trigger).clone().removeAttr('id').addClass(this._triggerClass)
					[inst.options.isRTL ? 'insertBefore' : 'insertAfter'](elem).
					click(function() {
						if (!plugin.isDisabled(elem[0])) {
							plugin[plugin.curInst === inst ? 'hide' : 'show'](elem[0]);
						}
					}));
			this._autoSize(elem, inst);
			var dates = this._extractDates(inst, elem.val());
			if (dates) {
				this.setDate(elem[0], dates, null, true);
			}
			var defaultDate = inst.get('defaultDate');
			if (inst.options.selectDefaultDate && defaultDate && inst.selectedDates.length === 0) {
				this.setDate(elem[0], (defaultDate || inst.options.calendar.today()).newDate());
			}
		}
function ( elem , inst ) { elem . off ( 'focus.' + inst . name ) ; if ( inst . options . showOnFocus ) { elem . on ( 'focus.' + inst . name , this . show ) ; } if ( inst . trigger ) { inst . trigger . remove ( ) ; } var trigger = inst . options . showTrigger ; inst . trigger = ( ! trigger ? $ ( [ ] ) : $ ( trigger ) . clone ( ) . removeAttr ( 'id' ) . addClass ( this . _triggerClass ) [ inst . options . isRTL ? 'insertBefore' : 'insertAfter' ] ( elem ) . click ( function ( ) { if ( ! plugin . isDisabled ( elem [ 0 ] ) ) { plugin [ plugin . curInst === inst ? 'hide' : 'show' ] ( elem [ 0 ] ) ; } } ) ) ; this . _autoSize ( elem , inst ) ; var dates = this . _extractDates ( inst , elem . val ( ) ) ; if ( dates ) { this . setDate ( elem [ 0 ] , dates , null , true ) ; } var defaultDate = inst . get ( 'defaultDate' ) ; if ( inst . options . selectDefaultDate && defaultDate && inst . selectedDates . length === 0 ) { this . setDate ( elem [ 0 ] , ( defaultDate || inst . options . calendar . today ( ) ) . newDate ( ) ) ; } }
Attach events and trigger, if necessary.
@memberof CalendarsPicker
@private
@param elem {jQuery} The control to affect.
@param inst {object} The current instance settings.
Attach events and trigger if necessary .