1、WdatePicker最大值限制

<!-- 日期最大值变量 -->
<input type="hidden" >
<!-- 日期选择款 -->
<input  
onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'limitDate\')}'})" readonly="readonly">

2、js日期转换——日期转字符串

Date.prototype.Format = function (fmt) {
            var o = {
                "M+": this.getMonth() + 1, //月份 
                "d+": this.getDate(), //
                "H+": this.getHours(), //小时 
                "m+": this.getMinutes(), //
                "s+": this.getSeconds(), //
                "q+": Math.floor((this.getMonth() + 3) / 3), //季度 
                "S": this.getMilliseconds() //毫秒 
            };
            if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
            for (var k in o)
            if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
            return fmt;
        } 
var dateStr = new Date().Format("yyyy-MM-dd HH:mm:ss"); // 调用

3、js日期转换——字符串转日期

var dateStr = new Date().Format("yyyy-MM-dd HH:mm:ss");
dateStr = dateStr.replace(/-/g, '/'); 
var newestDate = new Date(dateStr).getTime();

4、获取昨天的日期

 new Date((new Date().getTime()-24*60*60*1000)).Format("yyyy-MM-dd");

  

相关文章:

  • 2022-01-01
  • 2021-10-10
  • 2022-12-23
  • 2022-01-24
  • 2021-11-27
  • 2021-11-27
  • 2021-11-27
猜你喜欢
  • 2021-12-12
  • 2022-12-23
  • 2022-01-29
  • 2021-07-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案