<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. linux下启动jar包

    一.jdk 1.安装jdk 2.查看 摘自:(29条消息) Linux如何查看JDK的安装路径_fanyuna的博客-CSDN博客_linux查看jdk安装位置 1:echo $JAVA_HOME 使 ...

  2. virtualBox虚拟机中安装linux系统并连接

    1.安装virtualBox 1.1.下载 virtualBox是免费的,直接去官网下载 https://www.virtualbox.org/ 在官网左侧找到Downloads,下载需要的版本 1. ...

  3. 在端点0由GET_REPORT类请求上传报表

    目录 一般来说HID设备的报表在端点数量资源充裕的情况下都走中断端点上传,不会走控制端点即端点0上传,如果资源不足,可以利用端点0上传报表,USB协议中也是支持在端点0上传报表的. 以CH582为例, ...

  4. kafka数据顺序一致

    问题: kafka如何发送顺序消息 方案:kafka可以通过partitionKey,将某类消息写入同一个partition,一个partition只能对应一个消费线程,以保证数据有序. 也就是说生产 ...

  5. Python全栈学习笔记---问题总结(五)

    一.全局变量和局部变量 在函数内声明全局变量:globle 二.数值型lis和字符型list转换 数值型list转字符型list 3.x: array = [1, 2, 3, 4, 5,6 ] arr ...

  6. rabbitmq的Exchange类型案例

    一.direct(将消息转发到指定Routing key的Queue上,Routing key的解析规则为精确匹配) publish代码 consumer代码,绑定了另一个队列 优先启动publish ...

  7. data_analysis:初识numpy

    import numpy as npimport pandas as pd# """第一种,使用loadtxt"""# # 加载数据路径# ...

  8. Flink1.10定义UDAGG遇到SQL validation failed. null 问题

    按照以下代码测试定义的UDAGG会一直出现org.apache.flink.table.api.ValidationException: SQL validation failed. null 问题 ...

  9. Metasploit渗透测试框架二

    Metasploit基本使用方法 Metasploit基本命令 Metasploit程序需要使用Postgresql数据库. Postgresql是一种特性齐全的自由软件的对象-关系型数据库管理系统( ...

  10. Python扩展(pybind11混编)

    背景介绍pybind11是一个基于C++11标准的模版库. 与Boost.Python类似, pybind11主要着眼于创建C++代码的Python封装, 并为其提供了一套轻量级的解决方案. 安装与代 ...