Checked in patch for bug 259463:

Date Problem-can not accept date before 01/01/1601 ,show blank
This commit is contained in:
mostafah%oeone.com 2004-10-26 17:34:02 +00:00
Родитель 58def2143c
Коммит c5ebbadbe1
1 изменённых файлов: 20 добавлений и 8 удалений

Просмотреть файл

@ -148,17 +148,29 @@
<method name="update">
<parameter name="aValue"/>
<parameter name="refresh"/>
<parameter name="aRefresh"/>
<body><![CDATA[
if (aValue == null) { // invalid date, revert to previous date
// set textBox.value property, not attribute
this.kTextBox.value = this.formatDate(this.mValue);
} else {
if (aValue != null) {
// format fails if year <= 1600 on win2k, so try format first.
var formattedValue = null;
try {
formattedValue = this.formatDate(aValue);
} catch (ex) {} // fall thru
if (formattedValue) {
// format succeeded, safe to set value
this.mValue = aValue;
this.kTextBox.value = this.formatDate(this.mValue);
this.kTextBox.value = formattedValue;
// called before constructor, so check aRefresh before kCallBack
if( refresh != false && this.kCallback )
this.kCallback();
if ( aRefresh != false && "kCallback" in this)
this.kCallback();
return;
}
}
// invalid date, revert to previous date
// set textBox.value property, not attribute
if (this.mValue) {
this.kTextBox.value = this.formatDate(this.mValue);
}
]]></body>
</method>