日期:2014-05-16  浏览次数:20351 次

extjs年月日处理
var t1 = Ext.getCmp('crate_Start_ID').getValue();		
		var t2 = Ext.getCmp('create_End_ID').getValue();
		//注意:月份和日期必须补齐两位
		obj.crate_start_time = (t1!=''?t1.getYear()+'-'+ ((t1.getMonth()+1)<10?'0':'') + (t1.getMonth()+1)+'-'+(t1.getDate()<10?'0':'')+t1.getDate():'1988-01-01'); 
		obj.crate_end_time =   (t2!=''?t2.getYear()+'-'+ ((t2.getMonth()+1)<10?'0':'') + (t2.getMonth()+1)+'-'+(t2.getDate()<10?'0':'')+t2.getDate():'2088-01-01'); 
//		alert('t1.getYear()='+t1.getYear() + '  t1.getMonth()='+t1.getMonth()+ '  t1.getDate()='+t1.getDate());
//		alert('crate_start_time='+obj.crate_start_time + '  crate_end_time='+obj.crate_end_time);
		if(obj.crate_start_time>obj.crate_end_time){
				Ext.Msg.alert('温馨提示','开始日期不能大于结束日期!');
				return;
		 }