For extjs4
The default value of the datefield date control, which is the first day of the current day, And the last month.
Ext. Date. MONTH
Ext. Date. YEAR
Ext. Date. DAY
'Date', {xtype: 'datefield ', itemId: 'begindate', format: 'Y-m-d', value: Ext. util. format. date (Ext. date. add (new Date (), Ext. date. MONTH,-1), "Y-m-d")}, '-', {xtype: 'datefield ', itemId: 'enddate', format: 'Y-m-d', value: Ext. util. format. date (Ext. date. add (new Date (), Ext. date. MONTH, 1), "Y-m-d ")},
For versions earlier than extjs4:
Do not set the current date new Ext. form. dateField ({fieldLabel: 'start time', name: 'starttime', id: 'starttimeid', enableKeyEvents: true, width: 110, format: 'Y-m-d H: i: s', value: new Date (). add (Date. DAY,-7), emptyText: 'displayed when it is null '}),
Set the current date new Ext. form. dateField ({fieldLabel: 'End time', name: 'endtime', id: 'endtimeid', enableKeyEvents: true, width: 110, format: 'Y-m-d H: i: s', value: new Date ()})