antVue range-picker 限制当前时间之前的时间不可选择
<a-range-picker
:format="dateFormat"
size="small"
:showToday="true"
class="org-rang-Time"
allowClear
:show-time="{hideDisabledOptions:true}"
:disabled-date="disabledDate"
:disabled-time="disabledRangeTime"
v-decorator="['orgStartEndTime',validatorRules.orgStartEndTime]"
:placeholder="['开始时间', '结束时间']"
@change="onTimeChange"/>
两个知识点:1.时间重置;2.时间限制
onTimeChange(value, dateString){//任务起止时间设置
if(value.length>0){
this.orgStartEndTime = value;
this.beginTime = dateString[0];
this.endTime =dateString[1];
}else{
// 时间重置
this.orgStartEndTime = moment([]).format('YYYY-MM-DD HH:mm:ss');
this.beginTime ='';
this.endTime ='';
}
},
range(start, end) {
const result = [];
for (let i = start; i < end; i++) {
result.push(i);
}
return result;
},
disabledDate(current) {
// 禁用当前时间之前的时间
return current < moment().startOf('day');
},
disabledRangeTime(_, type) {
if (type === 'start') {
return {
disabledHours: () => this.range(0, moment().hour()),
disabledMinutes: () => this.range(0, moment().minute()),
disabledSeconds: () => this.range(0, moment().second())
};
}
return {
// disabledHours: () => this.range(0, 60).splice(20, 4),
// disabledMinutes: () => this.range(0, 30),
// disabledSeconds: () => this.range(0, 60),
};
},
antVue range-picker 限制当前时间之前的时间不可选择的更多相关文章
- Date Range Picker时间插件非常不错,主要体现在选择一个时间区间
地址:http://www.daterangepicker.com/ demo地址:http://tamble.github.io/jquery-ui-daterangepicker/#event a ...
- How to add a date range picker to filter for dates on a GridView for Yii2 - See more at: http://www.2amigos.us/blog/how-to-add-a-date-range-picker-to-filter-for-dates-on-a-gridview-for-yii2#sthash.pf7
Filtering the data we have on our GridView by dates are sometimes very important. On this article I ...
- mysql中TIMESTAMP设置默认时间为当前时间
在我们保存数据进入到数据库中时多半会使用像php之类的脚本来获取一个时间保存到mysql中,其实在mysql可以直接使用TIMESTAMP 数据类型来实现默认类型了,下面一起来看看. 很多时候,为 ...
- Python: 处理mongodb文档,怎么让UTC时间转换为本地时间?
存储数据到MongoDB数据库时,一般我们会加一个更新数据的时间update_time.这时在python代码中 会用到datetime模块以便获取当前系统时间,但是存入到MongoDB数据库时,存储 ...
- JavaScript把客户端时间转换为北京时间
写在前面 写了一遍又一遍,网页老卡住,没保存下来,不写了. 时间转换代码 //获得北京时间 Date.prototype.getBJDate = function () { //获得当前运行环境时间 ...
- ubuntu下的时间设定(硬件时间,系统时间,本地时间)
问题的来由是在这里: 在cron里设定任务是在凌晨6点执行,检查日志时发现时间总是不对,是在22点左右的时间执行的.研究发现,任务是在本地时间的6点执行了,但不知为什么syslog中的时间都是为utc ...
- java new Date()得到的时间和系统时间不一样
造成这种问题的原因是:操作系统时区跟JVM的时区不一致. [root@paas244 ~]# timedatectl Local time: Thu 2016-12-29 15:35:44 CST U ...
- Linux 系统时间和硬件时间
linux 的系统时间有时跟硬件时间是不同步的 Linux时钟分为系统时钟(System Clock)和硬件(Real Time Clock,简称RTC)时钟.系统时钟是指当前Linux Kernel ...
- CloudStack中云主机的UTC时间转为本地时间
CloudStack项目中使用的时间是UTC时间,具体什么是UTC时间大家可以百度,但是我们需要的时间是正常的时间,所以在国泰君安开发测试云中,同步资源管理中虚拟机的同步管理,需要对虚拟机的时间格式化 ...
- My97DatePicker 日期控制,开始时间不能>结束时间,结束时间不能<开始时间
<li>日期: <input type="text" style="margin-top: 5px;" value="${begin ...
随机推荐
- [CSS]隐藏浏览器滚动条
::-webkit-scrollbar { display: none; /* Chrome Safari */ }
- java SE01
目录 一.基础语言 1. 注释 a. 行内注释 b. 多行注释 c. 文档注释 2. 关键字 3. 数据类型 a.基本数据类型 b.引用数据类型 c. 类型转换 4. 变量类型 a. 类变量 b. 实 ...
- Dilworth
Dilworth 定理 偏序集能划分成的最少的全序集个数等于最大反链的大小. 名词解释 偏序 在集合 \(S\) 中定义的二元关系 \(\le\),如果它满足以下三个性质: 自反性:\(\forall ...
- pure-ftpd
1.安装服务 yum install epel-release yum -y install pure-ftpd 2.启动服务如果报错,看一下是否是缺库文件导致. locate libpq.so.5 ...
- Springboot多数据源使用示例
1.配置文件 spring.datasource.url=jdbc:mysql://198.168.1.1:3306/user?useUnicode=true&characterEncodin ...
- vue3.0学习笔记
vue3转vue2: https://vue-next-template-explorer.netlify.app/ 1. Vue3.0六大两点 Performance:性能比Vue2.x快1.2~2 ...
- Delphi 移除窗口最大化按钮
很遗憾,好像没有直接的代码可以操作,可以试试以下代码: var GWL_Result: Integer; begin GWL_Result:= GetWindowLong(Handle,GWL_STY ...
- vue input输入框关键字筛选检索列表数据展示
想必大家在项目开发中难免会用到关键字筛选的功能,正好这次项目有需求要做这一块,就整理一下vue的input输入框输入关键字检索数据列表的代码.下面直接上代码: html: <!-- 筛选demo ...
- VUE3+VITE 常见问题解决
reactive解构最深的一层,失去响应性问题 pinia创建的store,使用结构失去响应性 reactive包裹后的对象 重新赋值失去响应性 无法动态引入图片 在computed中传参数 vue3 ...
- go 的 wire 依赖注入
首先安装 wire 工具 go install github.com/google/wire/cmd/wire@latest go 文件 package main import ( "fmt ...