zoukankan      html  css  js  c++  java
  • 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 = new Date(); crmForm.all.new_enddate.DataValue = new Date(); alert("计划开始日期不能小于当前日期!"); }
  • 相关阅读:
    【题解】Candle
    【题解】购物
    【题解】论逼格
    浅谈前缀和
    浅谈 LCA
    浅谈Meet in the middle——MITM
    拓扑排序
    时间复杂度符号
    浅谈排序算法[动图]
    404 页面不存在
  • 原文地址:https://www.cnblogs.com/BinBinGo/p/6129691.html
Copyright © 2011-2022 走看看