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

    05:09:37 HOCON github https://github.com/lightbend/config/blob/master/HOCON.md 相较于 XML, JSON, YAML 更 ...

  2. Tooltip 文字提示,居中显示

    Tooltip 文字提示有时候在table中无法居中显示,这个可以设置一下 <a-tooltip placement="top" overlayClassName=" ...

  3. java中Atomic变量的实现原理是怎样的?

    转载自: Java3y https://www.zhihu.com/question/39130725/answer/1006948362 一.基础铺垫 首先我们来个例子: public class ...

  4. clear

    BFC虽然可以达到外部背景由内部内容撑开的效果,但是存在副作用 所以由clear将affter受浮动效果解除,来解决以上问题

  5. Window10上CLion极简配置教程

    Window10上CLion极简配置教程 1. 首先,下载安装CLion 去JB公司官网下载CLion,https://www.jetbrains.com/clion/download/#sectio ...

  6. 无线网络技术 实验2 无线网络环境RSSI测试实验

    1.实验目的与要求 ①.了解RSSI的概念和基本原理 ②.掌握RSSI测量过程和方法 ③.不同无线环境下RSSI值测量 2.实验仪器材料:个人计算机 Windows操作系统 个人热点 3.实验过程记录 ...

  7. .什么是 SPA 单页面,它的优缺点分别是什么

    SPA( single-page application )即一个web项目就只有一个页面(即一个HTML文件,HTML 内容的变换是利用路由机制实现的. 仅在 Web 页面初始化时加载相应的 HTM ...

  8. RealSenseD435的一些参数整理

    一.深度相机D435 二.自校准功能 https://www.intelrealsense.com/self-calibration-for-depth-cameras/ https://dev.in ...

  9. Python-闭包(Closure)

    一.认识闭包 有时候需要在函数外部得到函数内部的局部变量,但是由于Python作用域的关系,这一点是无法实现的. def f(): n = 22 print(n) #NameError:name 'n ...

  10. win10 U盘重装系统

    1.做好U盘 2.F7选择U盘启动,不用F2切换启动顺序 3.IQY一键安装 4.重启前拔掉U盘 5.如果重启后蓝屏显示 恢复,重新进入PE使用 windows引导恢复,再重新启动