If you want to display it correctly, the general method is to change the background code so that the date and time format changes to string return. My solution is to rewrite the setValue of TimeField. The specific code is as follows:
Ext.override(Ext.form.TimeField, {
getValue: function () {
return this.value;
},
setValue: function (v) {
this.value = v;
this.setRawValue(this.formatValue(v));
return this;
},
formatValue: function (v) {
if (v.length>8) { //The maximum number of timefields cannot exceed 8. If the number is greater than 8, it must be
var jsondate = eval in json ("new " v.substr(1, v.length - 2)).toLocaleTimeString();
jsondate = jsondate.length == 8 ? jsondate.substr(0, 5) : '0' jsondate.substr( 0, 4); //toLocaleTimeString is relatively stupid, if the hour returned is less than 10 hours, there is only 1 digit
return jsondate;
}
return v;
}
});