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 ...
随机推荐
- Excel工具(批量生成txt)
Sub txt() Dim i, j, arr(), brr(), myRow, myCol arr = Sheet1.UsedRange myRow = UBound(arr, 1) myCol = ...
- toast简介
PostgreSQL数据库不允许元组(行,记录)跨越多个页面(page)存储,所以,它不能直接存储非常大的字段值.对于大字段值,它将被压缩且(或)分解为多个物理行,该技术称为"TOAST&q ...
- 如何进行多平台部署Client和Server详细讲解
一:signalR把console用做客户端访问服务端方法 1:新建一个控制台应用程序(ClientConsole) 2:用nuget安装SignalR.Client(必须,下面是nuget命令) I ...
- hive中时间-日期函数的用法
current_date:获取当前日期 用法:select current_date: 输出:2020-12-04 unix_timestamp:获取当前unix时间戳 用法:select unix_ ...
- 搭建ubuntu开发环境
tar -xzvf VMwareTools-10.0.6-3595377.tar.gz cd vmware-tools-distrib 再执行:sudo ./vmware-install.pl ...
- 230219 Business 1-30
1: Packing for a Business TripWhat should I bring on this business trip?Haven't you been on a busine ...
- mysql企业常用集群架构
转自 https://blog.csdn.net/kingice1014/article/details/76020061 1.mysql企业常用集群架构 在中小型互联网的企业中.mysql的集群一般 ...
- linux dma
https://bootlin.com/pub/conferences/2015/elc/ripard-dmaengine/ripard-dmaengine.pdf https://biscuitos ...
- OKHttp 之--------http/https协议处理方法 (Finn_ZengYuan博客)
如果遇到okttp需要使用https协议,那么就需要在支持ssl,不说了,撸码搞起: 加入下面代码即可搞定:主要就是设置 builder.sslSocketFactory(sslParams.sSLS ...
- OpenLayer——模拟运动轨迹
模拟在人地图上移动,动态绘制行动轨迹的功能,附带一个跟随的气泡弹窗. <!DOCTYPE html> <html lang="en"> <head&g ...