当前位置: 首页 > news >正文

el-date-picker时间范围只能选五分钟之内

el-date-picker时间范围只能选五分钟之内

  • 一、主要代码

一、主要代码

<el-date-pickertype="datetime"size="small"value-format="yyyy-MM-dd HH:mm:ss"v-model="searchData.submitTimeCode":editable="false"placeholder="选择开始日期"@change="changeEnddate()"
></el-date-picker><el-date-pickerv-model="searchData.submitTimeCodeMin"type="datetime"size="small"placeholder="选择结束日期"value-format="yyyy-MM-dd HH:mm:ss":editable="false":picker-options="{disabledDate: time => {return (time.getTime() >new Date(this.searchData.submitTimeCode).getTime() ||time.getTime() <new Date(this.searchData.submitTimeCode).getTime() -20 * 3600 * 1000)},selectableRange: dafaulttime,}"
></el-date-picker>formatDate(data) {let now = new Date(data)var hour = now.getHours() < 10 ? '0' + now.getHours() : now.getHours()var minute = now.getMinutes() < 10 ? '0' + now.getMinutes() : now.getMinutes()var second = now.getSeconds() < 10 ? '0' + now.getSeconds() : now.getSeconds()return hour + ':' + minute + ':' + second
},
changeEnddate() {let dafaulttime = new Date(this.searchData.submitTimeCode).getTime() + 10 * 60 * 1000 //开始时间之后的五分钟时间戳this.dafaulttime =this.formatDate(new Date(this.searchData.submitTimeCode).getTime()) +'-' +this.formatDate(dafaulttime)
},

链接: https://blog.csdn.net/qq_33769914/article/details/108754228

http://www.lryc.cn/news/97568.html

相关文章:

  • 大数据分析案例-基于LightGBM算法构建乳腺癌分类预测模型
  • Java中的io流
  • 23 自定义控件
  • 从原理到实践,分析 Redisson 分布式锁的实现方案(二)
  • QT【day3】
  • 模版模式和策略模式的区别
  • Github搭建个人博客全攻略
  • gensim conherence model C_V 值与其他指标负相关BUG
  • QT DAY3
  • TortoiseGit(小乌龟)使用问题总结
  • 106、Redis和Mysql如何保证数据一致
  • SpringBoot+jasypt-spring-boot-starter实现配置文件明文加密
  • k8s核心概念
  • opencv 处理的视频 保存为新视频 ,新视频 无法读取
  • 《golang设计模式》第一部分·创建型模式-02-原型模式(Prototype)
  • SpringCloudAlibaba微服务实战系列(一)Nacos服务注册发现
  • 23.7.27 牛客暑期多校4部分题解
  • Ubuntu 20.04 安装教程
  • 如何评判算法好坏?复杂度深度解析
  • 【HashMap】2352. 相等行列对
  • 如何声明静态方法 和 实现?
  • 哈工大计算机网络课程局域网详解之:无线局域网
  • 系统集成|第六章(笔记)
  • MySQL主从复制环境部署
  • day42-servlet下拉查询/单例模式
  • docker中设置容器健康检查
  • azure-cognitiveservices-speech api error while using with AWS Lambda
  • 系统集成项目管理工程师挣值分析笔记大全
  • TCP 协议【传输层协议】
  • Golang 中的 time 包详解(二):time.Duration