禁止过期时间小于生产日期时间

2018-11-05  本文已影响0人  ___大鱼___
            
            var ProductionDate = $('#ProductionDate').val();
            var ExpirationDate = $('#ExpirationDate').val();
            var beginDate = new Date(Date.parse(ProductionDate.replace(/-/g, '/')));
            var endDate = new Date(Date.parse(ExpirationDate.replace(/-/g, '/')));
            var dateDiff = endDate.getTime() - beginDate.getTime();
            if(dateDiff < 0){
                msg('过期日期不能小于生产日期 ! ');
                return false
            }
上一篇 下一篇

猜你喜欢

热点阅读