获取时间戳

可以通过一下来获取时间戳

js获取当前时间戳,

var timestamp = (new Date()).valueOf();
ant design vue 时间选择器到最大日期
  disabledEndDate (endValue) {
      const startValue = new Date()
      if (!endValue || !startValue) {
        return false
      }
      return startValue.valueOf() <= endValue.valueOf()
    }
当通过ant design vue中的month-picker进行年月的设置时
html代码中如下所示
<a-month-picker @change="onChangeStart" :disabledDate="disabledStartDate" placeholder="开始日期" style="20%;" v-model="startDate"/>
 <a-month-picker @change="onChangeEnd" :disabledDate="disabledEndDate" placeholder="结束日期" style="20%;"  v-model="endDate"/>
通过这样来设置限制年月,上面示例为202001-202212月份,只能在这个区间中选择。
 
原文地址:https://www.cnblogs.com/zoutuan/p/13415306.html