Ext.form.DateField 的默认值的设置方法
1,设置当前日期
??????? new Ext.form.DateField({??????? fieldLabel : '结束时间',??????? name : 'endTime',??????? id : 'endTimeId',??????? enableKeyEvents : true,??????? width : 110,??????? format : 'Y-m-d H:i:s',
?????? value:new Date()?????? })
2,不设置当前日期
new Ext.form.DateField({??????? fieldLabel : '起始时间',??????? name : 'startTime',??????? id : 'startTimeId',??????? enableKeyEvents : true,??????? width : 110,??????? format : 'Y-m-d H:i:s',??????? value:new Date().add(Date.DAY, -7),??????? emptyText : '为空的时候显示'?????? }),
ext4
// Basic usage:var dt = Ext.Date.add(new Date('10/29/2006'), Ext.Date.DAY, 5);console.log(dt); //returns 'Fri Nov 03 2006 00:00:00'// Negative values will be subtracted:var dt2 = Ext.Date.add(new Date('10/1/2006'), Ext.Date.DAY, -5);console.log(dt2); //returns 'Tue Sep 26 2006 00:00:00'