el-form-item( label="推送时间", prop="activitydate")
el-date-picker( v-model="popupform.activitydate", type="daterange", range-separator="至", start-placeholder="开始日期", end-placeholder="结束日期", value-format="yyyy-MM-dd" )
export default {
data() {
const checkactivitydate = (rule, value, callback) => {
if (!value || value.length < 2) {
callback(new Error('时间不能为空'));
}
if (value && value.length === 2) {
if (new Date(value[0]).getTime() < Date.now() - 8.64e7) {
callback(new Error('开始时间必须在当前时间之后'));
}
}
callback();
};
return {
popupform: { activitydate: [] }
rules: {
activitydate: [{ validator: checkactivitydate }],
},
}