首页 > 代码库 > CRM 日期类型的一些处理JS
CRM 日期类型的一些处理JS
//当前日期var now = new Date();//换算为毫秒数var now_ms = Date.UTC( now.getFullYear(), now.getMonth(),now.getDate());
//getMonth 从0-11 所以真实月份要+1, getDate 注意与 getDay的区别,getDate为日, getDay 为周//计算开始日期var _form_date =crmForm.all.new_begindate.DataValue ;//计划开始日期加8 小时var form_date = new Date(_form_date.setHours(_form_date.getHours()+8)); var form_ms =Date.UTC(form_date.getFullYear(), form_date.getMonth(),form_date.getDate()); if(form_ms < now_ms){ //如果计划开始日期小于当前日期禁止保存 crmForm.all.new_begindate.DataValue = http://www.mamicode.com/new Date(); crmForm.all.new_enddate.DataValue = new Date(); alert("计划开始日期不能小于当前日期!");}
CRM 日期类型的一些处理JS
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。