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;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值