<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 限制当前时间之前的时间不可选择的更多相关文章

  1. Date Range Picker时间插件非常不错,主要体现在选择一个时间区间

    地址:http://www.daterangepicker.com/ demo地址:http://tamble.github.io/jquery-ui-daterangepicker/#event a ...

  2. 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 ...

  3. mysql中TIMESTAMP设置默认时间为当前时间

    在我们保存数据进入到数据库中时多半会使用像php之类的脚本来获取一个时间保存到mysql中,其实在mysql可以直接使用TIMESTAMP 数据类型来实现默认类型了,下面一起来看看.   很多时候,为 ...

  4. Python: 处理mongodb文档,怎么让UTC时间转换为本地时间?

    存储数据到MongoDB数据库时,一般我们会加一个更新数据的时间update_time.这时在python代码中 会用到datetime模块以便获取当前系统时间,但是存入到MongoDB数据库时,存储 ...

  5. JavaScript把客户端时间转换为北京时间

    写在前面 写了一遍又一遍,网页老卡住,没保存下来,不写了. 时间转换代码 //获得北京时间 Date.prototype.getBJDate = function () { //获得当前运行环境时间 ...

  6. ubuntu下的时间设定(硬件时间,系统时间,本地时间)

    问题的来由是在这里: 在cron里设定任务是在凌晨6点执行,检查日志时发现时间总是不对,是在22点左右的时间执行的.研究发现,任务是在本地时间的6点执行了,但不知为什么syslog中的时间都是为utc ...

  7. java new Date()得到的时间和系统时间不一样

    造成这种问题的原因是:操作系统时区跟JVM的时区不一致. [root@paas244 ~]# timedatectl Local time: Thu 2016-12-29 15:35:44 CST U ...

  8. Linux 系统时间和硬件时间

    linux 的系统时间有时跟硬件时间是不同步的 Linux时钟分为系统时钟(System Clock)和硬件(Real Time Clock,简称RTC)时钟.系统时钟是指当前Linux Kernel ...

  9. CloudStack中云主机的UTC时间转为本地时间

    CloudStack项目中使用的时间是UTC时间,具体什么是UTC时间大家可以百度,但是我们需要的时间是正常的时间,所以在国泰君安开发测试云中,同步资源管理中虚拟机的同步管理,需要对虚拟机的时间格式化 ...

  10. My97DatePicker 日期控制,开始时间不能>结束时间,结束时间不能<开始时间

    <li>日期: <input type="text" style="margin-top: 5px;" value="${begin ...

随机推荐

  1. .NET版本发展史

    .NET从始至今可以分为3个阶段,分别是.NET Framework阶段..NET Core阶段..NET阶段: .NET Framework终结于.NET Framework4.8版本,.NET C ...

  2. el-table多选框根据条件隐藏显示

    提供一个方法, 通过添加相应类来控制样式,设置 display: none ,达到隐藏 checkbox 的目的. 利用Table Attributes 属性里面的 cell-class-name 属 ...

  3. 西湖论剑2023-mp3[wp]

    一 题目描述 二 解题步骤 1.分析文件 (1)放入Audacity中查看频谱信息无果 (2)010editor中查看文件结构 文件尾部存在PNG文件尾,搜索png文件头 将该png文件复制提取出来, ...

  4. 2015 for Mac PDF编辑软件

    ​ 开始前请先断开网络连接,断网,断网,断网! 开始前请先断开网络连接,断网,断网,断网! 开始前请先断开网络连接,断网,断网,断网! ​编辑 1.软件下载完成后,打开软件包如上图五个文件(第1个是安 ...

  5. CentOS 7--Nginx安装

    1.安装依赖 yum install -y gcc-c++pcre pcre-develzlib zlib-developenssl openssl-devel 2.下载Nginx wget http ...

  6. Go语言快速入门

    简介 Go是一个专门针对多处理器系统应用程序的编程进行了优化的,可以媲美C或C++代码的速度,而且更加安全.支持并行进程的语言. Go支持面向对象,而且具有真正的闭包(closures)和反射 (re ...

  7. bpmn的依赖注入

    主要对象 new BPMN对象时,流程及对象结构如下图 依赖注入 在初始化bpmn对象时有传入additionalModules进行自定义操作,具体是如何实现这种模块化的管理,主要是用到了依赖注入ht ...

  8. KETTLE 首次连DB2报错,无驱动。

    DB2 把相应数据库的jar包放入 data-integration\lib 或者data-integration\libswt\win64 重启kettle程序 连接成功 驱动包,我是用的aqua工 ...

  9. Postman 测试 Web Service 和 WCF

    一.postman 测试web service(1)设置url http://www.oorsprong.org/websamples.countryinfo/countryinfoservice.w ...

  10. Java基础学习:8、构造器(构造方法)和this

    一.构造器: 1.定义:构造器是类的特殊方法,它的主要作用是完成对象的初始化.          即在创建对象时初始化对象.   本质是方法. 2.特点: a.方法名和类名一致. b.无返回值. c. ...