0
点赞
收藏
分享

微信扫一扫

[Microsoft Office]Word设置页码从第二页开始为1

mm_tang 2024-07-24 阅读 29

限制选取的日期范围
效果图
在这里插入图片描述

<a-date-picker
    v-model="dateTime"
    format="YYYY-MM-DD"
    :disabled-date="disabledDate"
    valueFormat="YYYY-MM-DD"
    placeholder="请选择日期"
    allowClear
/>



methods:{
	//回放日期选取范围限制,从今天往前推三十天
	disabledDate(value) {
	    const curDate = new Date().getTime();
	    // 这里设置天数,这里为30天
	    const numMonth = 30 * 24 * 3600 * 1000;
	    const threeMonths = curDate - numMonth;
	    return new Date(value).getTime() > curDate || new Date(value).getTime() < threeMonths;
	},
}
举报

相关推荐

0 条评论