code: function(id, dateStr) {
  		var onSelect,
  			target = $(id),
  			inst = this._getInst(target[0]);
  
  		dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
  		if (inst.input) {
  			inst.input.val(dateStr);
  		}
  		this._updateAlternate(inst);
  
  		onSelect = this._get(inst, "onSelect");
  		if (onSelect) {
  			onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);  // trigger custom callback
  		} else if (inst.input) {
  			inst.input.trigger("change"); // fire the change event
  		}
  
  		if (inst.inline){
  			this._updateDatepicker(inst);
  		} else {
  			this._hideDatepicker();
  			this._lastInput = inst.input[0];
  			if (typeof(inst.input[0]) !== "object") {
  				inst.input.focus(); // restore focus
  			}
  			this._lastInput = null;
  		}
  	}
docs: /* Update the input field with the selected date.