当前位置:网站首页>el-date-picker 设置时间范围
el-date-picker 设置时间范围
2022-08-04 16:59:00 【背藏玫瑰】
需求是发布时间超过当天6点不能设置当天
<el-form-item label="发布日期" prop="releaseDate">
<el-date-picker
v-model="form.releaseDate"
@change="releaseDateChange"
value-format="yyyy-MM-dd"
type="date"
placeholder="选择日期"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
pickerOptions: {
disabledDate: (time) => {
// 当天时间点 :6点
const timeLine = 6;
var myDate = new Date();
let delay = this.cunrentTime + " 00:00:00";
const currentTime = time.getTime();
const hours = myDate.getHours();
const targetTime = new Date(delay).getTime();
if (delay) {
if (currentTime < targetTime) {
return true;
} else if (currentTime == targetTime) {
if (hours < timeLine) {
return false;
} else {
return true;
}
} else {
return false;
}
}
},
},
随笔
边栏推荐
猜你喜欢
随机推荐
(1), the sequential storage structure of linear table chain storage structure
Mobile magic box CM211-1_YS foundry _S905L3B_RTL8822C_wire brush firmware package
Taurus.MVC WebAPI 入门开发教程2:添加控制器输出Hello World。
ctfshow 萌新web1-21
海报 | 夏季高温,危化品安全风险的注意事项必须get!
SRM Supplier Collaborative Management System Function Introduction
Qt自动补全之QCompleter使用
shell脚本详解 --------循环语句之for循环
华为云数据治理生产线DataArts,让“数据‘慧’说话”
显示和设置系统日期时间的date命令示例
太一集团宣布全资收购火币旗下社交产品火信
R语言使用cov函数计算矩阵或者dataframe数据变量之间的协方差、cor函数计算相关性、cor函数通过method参数指定相关性、相关性计算方法Pearson,Spearman, Kendall
(一)、线性表的顺序存储结构链式存储结构
Json的FastJson与Jackson
dotnet core 隐藏控制台
咪咕MGV2000KL南传_S905L3B_MT7668线刷固件包
【LeetCode每日一题】——540.有序数组中的单一元素
88.(cesium之家)cesium聚合图
跨域传递数据(iframe)
移动魔百盒CM201-1_CW_S905L2_MT7668_线刷固件包