Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WEBUI: Fix Ext.ux.form.TwinDateField setValue fcn
  • Loading branch information
perexg committed Dec 6, 2015
1 parent c3a38bb commit 7914d16
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/webui/static/app/extensions.js
Expand Up @@ -1010,6 +1010,8 @@ Ext.ux.form.TwinDateField = Ext.extend(Ext.form.DateField, {
}),

setValue : Ext.form.DateField.prototype.setValue.createSequence(function(v) {
if (!this.triggers)
return;
if (v !== null && v != '') {
if (this.allowClear)
this.getTrigger(0).show();
Expand Down Expand Up @@ -1591,7 +1593,7 @@ Ext.ux.form.TwinDateTimeField = Ext.extend(Ext.form.Field, {
return;
}
if ('number' === typeof val) {
val = new Date(val);
val = new Date(val * 1000);
} else if ('string' === typeof val && this.hiddenFormat) {
val = Date.parseDate(val, this.hiddenFormat);
}
Expand All @@ -1613,6 +1615,7 @@ Ext.ux.form.TwinDateTimeField = Ext.extend(Ext.form.Field, {
}
}
this.updateValue();
this.value = this.getValue();
},

/**
Expand Down

0 comments on commit 7914d16

Please sign in to comment.