Fixed 3547. Initialise alternate field on load for inline datepicker.

This commit is contained in:
Keith Wood 2008-11-08 07:34:34 +00:00
parent 4addec6ac2
commit 3946038509

View File

@ -246,6 +246,7 @@ $.extend(Datepicker.prototype, {
$.data(target, PROP_NAME, inst); $.data(target, PROP_NAME, inst);
this._setDate(inst, this._getDefaultDate(inst)); this._setDate(inst, this._getDefaultDate(inst));
this._updateDatepicker(inst); this._updateDatepicker(inst);
this._updateAlternate(inst);
}, },
/* Tidy up after displaying the date picker. */ /* Tidy up after displaying the date picker. */
@ -867,7 +868,7 @@ $.extend(Datepicker.prototype, {
_updateAlternate: function(inst) { _updateAlternate: function(inst) {
var altField = this._get(inst, 'altField'); var altField = this._get(inst, 'altField');
if (altField) { // update alternate field too if (altField) { // update alternate field too
var altFormat = this._get(inst, 'altFormat'); var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat');
var date = this._getDate(inst); var date = this._getDate(inst);
dateStr = (isArray(date) ? (!date[0] && !date[1] ? '' : dateStr = (isArray(date) ? (!date[0] && !date[1] ? '' :
this.formatDate(altFormat, date[0], this._getFormatConfig(inst)) + this.formatDate(altFormat, date[0], this._getFormatConfig(inst)) +