jquery-src/jquery.calendars.picker.js
function(elem, target) {
			var inst = this._getInst(elem);
			if (!$.isEmptyObject(inst) && !this.isDisabled(elem)) {
				var date = this.retrieveDate(elem, target);
				if (inst.options.multiSelect) {
					var found = false;
					for (var i = 0; i < inst.selectedDates.length; i++) {
						if (date.compareTo(inst.selectedDates[i]) === 0) {
							inst.selectedDates.splice(i, 1);
							found = true;
							break;
						}
					}
					if (!found && inst.selectedDates.length < inst.options.multiSelect) {
						inst.selectedDates.push(date);
					}
				}
				else if (inst.options.rangeSelect) {
					if (inst.pickingRange) {
						inst.selectedDates[1] = date;
					}
					else {
						inst.selectedDates = [date, date];
					}
					inst.pickingRange = !inst.pickingRange;
				}
				else {
					inst.selectedDates = [date];
				}
				inst.prevDate = inst.drawDate = date.newDate();
				this._updateInput(elem);
				if (inst.inline || inst.pickingRange || inst.selectedDates.length <
						(inst.options.multiSelect || (inst.options.rangeSelect ? 2 : 1))) {
					this._update(elem);
				}
				else {
					this.hide(elem);
				}
			}
		}
function(elem, target) {
			var inst = this._getInst(elem);
			if (!$.isEmptyObject(inst) && !this.isDisabled(elem)) {
				var date = this.retrieveDate(elem, target);
				if (inst.options.multiSelect) {
					var found = false;
					for (var i = 0; i < inst.selectedDates.length; i++) {
						if (date.compareTo(inst.selectedDates[i]) === 0) {
							inst.selectedDates.splice(i, 1);
							found = true;
							break;
						}
					}
					if (!found && inst.selectedDates.length < inst.options.multiSelect) {
						inst.selectedDates.push(date);
					}
				}
				else if (inst.options.rangeSelect) {
					if (inst.pickingRange) {
						inst.selectedDates[1] = date;
					}
					else {
						inst.selectedDates = [date, date];
					}
					inst.pickingRange = !inst.pickingRange;
				}
				else {
					inst.selectedDates = [date];
				}
				inst.prevDate = inst.drawDate = date.newDate();
				this._updateInput(elem);
				if (inst.inline || inst.pickingRange || inst.selectedDates.length <
						(inst.options.multiSelect || (inst.options.rangeSelect ? 2 : 1))) {
					this._update(elem);
				}
				else {
					this.hide(elem);
				}
			}
		}
function ( elem , target ) { var inst = this . _getInst ( elem ) ; if ( ! $ . isEmptyObject ( inst ) && ! this . isDisabled ( elem ) ) { var date = this . retrieveDate ( elem , target ) ; if ( inst . options . multiSelect ) { var found = false ; for ( var i = 0 ; i < inst . selectedDates . length ; i ++ ) { if ( date . compareTo ( inst . selectedDates [ i ] ) === 0 ) { inst . selectedDates . splice ( i , 1 ) ; found = true ; break ; } } if ( ! found && inst . selectedDates . length < inst . options . multiSelect ) { inst . selectedDates . push ( date ) ; } } else if ( inst . options . rangeSelect ) { if ( inst . pickingRange ) { inst . selectedDates [ 1 ] = date ; } else { inst . selectedDates = [ date , date ] ; } inst . pickingRange = ! inst . pickingRange ; } else { inst . selectedDates = [ date ] ; } inst . prevDate = inst . drawDate = date . newDate ( ) ; this . _updateInput ( elem ) ; if ( inst . inline || inst . pickingRange || inst . selectedDates . length < ( inst . options . multiSelect || ( inst . options . rangeSelect ? 2 : 1 ) ) ) { this . _update ( elem ) ; } else { this . hide ( elem ) ; } } }
Select a date for this datepicker.
@memberof CalendarsPicker
@param elem {Element} The control to examine.
@param target {Element} The selected datepicker element.
@example $(selector).datepick('selectDate', $('div.datepick-popup a:contains(10)')[0])
Select a date for this datepicker .