Answers
format的这个属性只要'Y-m-d',自己写了个简单的例子,测试了下,可用,给你参考下:
var dateF = new Ext.form.DateField({
columnWidth: 0.6,
validationDelay: 60000000,
listeners: {
'invalid': function () {
this.setValue('')
}
}
});
return new Ext.Panel({
required: conditionConfig.required,
isendtime: conditionConfig.isendtime,
conditionTitle: conditionConfig.conditionTitle,
columnWidth: 0.2,
layout: 'column',
border: false,
dateControl: dateF,
name: conditionConfig.conditionName,
items: [dateF],
getValue: function () {
if (conditionConfig.isendtime) return dateF.getValue().toString() == '' ? '' : (dateF.getValue().format('Y-m-d') + " " + (timeF.getValue() == '' ? '23:59' : timeF.getValue()));
else return dateF.getValue().toString() == '' ? '' : (dateF.getValue().format('Y-m-d') + " " + (timeF.getValue() == '' ? '00:00' : timeF.getValue()));
},
setValue: function (a) {
var tmp2 = a.indexOf(' ');
dateF.setValue(a.substring(0, tmp2));
}
});
额头上的川
answered 11 years, 11 months ago