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

antd vue a-range-picker如何设置不能选择当前和之后的时间,包含时分秒

<a-range-pickerv-model:value="formState.reqTime"show-timeformat="YYYY-MM-DD HH:mm:ss":disabledDate="disabledDate":disabledTime="disabledTime":placeholder="['开始时间', '结束时间']"style="width: 382px"separator="-"></a-range-picker>
import dayjs from 'dayjs';
setup() {const disabledDate = current => {return current && current > dayjs().endOf('day');};const range = (start, end) => {const result = [];for (let i = start; i < end; i++) {result.push(i);}return result;};function disabledTime(dates, partial) {const hours = dayjs().hour();const minutes = dayjs().minute();const seconds = dayjs().second();if (!dates) {dates = dayjs();}if (partial == 'start') {if (dates[0] && dayjs(dates[0]).date() === dayjs().date()) {if (dayjs(dates[0]).hour() === dayjs().hour()) {return {disabledHours: () => range(hours + 1, 24),disabledMinutes: () => range(minutes + 1, 60),disabledSeconds: () => range(seconds + 1, 60)};} else {return {disabledHours: () => range(hours, 24),disabledMinutes: () => [],disabledSeconds: () => []};}} else {return {disabledHours: () => [],disabledMinutes: () => [],disabledSeconds: () => []};}} else if (partial == 'end') {if (dates[1] && dayjs(dates[1]).date() === dayjs().date()) {if (dayjs(dates[1]).hour() === dayjs().hour()) {return {disabledHours: () => range(hours + 1, 24),disabledMinutes: () => range(minutes + 1, 60),disabledSeconds: () => range(seconds + 1, 60)};} else {return {disabledHours: () => range(hours, 24),disabledMinutes: () => [],disabledSeconds: () => []};}} else {return {disabledHours: () => [],disabledMinutes: () => [],disabledSeconds: () => []};}}}return {disabledDate,disabledTime};}

文章转载自:

http://wPmSedcF.hmqwn.cn
http://g5gAesPf.hmqwn.cn
http://YnoGYP1h.hmqwn.cn
http://X5ZHpQvE.hmqwn.cn
http://iKytgyZR.hmqwn.cn
http://vUoPCwtH.hmqwn.cn
http://5uJfNySi.hmqwn.cn
http://RRZ9vpOw.hmqwn.cn
http://vSr6YUS6.hmqwn.cn
http://LnAMQN1Q.hmqwn.cn
http://Uq4AZbE6.hmqwn.cn
http://2HuEIlGh.hmqwn.cn
http://RWjBHxUu.hmqwn.cn
http://SqozmuOt.hmqwn.cn
http://eRYjvCQE.hmqwn.cn
http://GQskGJDg.hmqwn.cn
http://X9R9yvYQ.hmqwn.cn
http://FU2uUFHV.hmqwn.cn
http://P8qYBRaU.hmqwn.cn
http://fKo2d9MR.hmqwn.cn
http://slXQd5Oy.hmqwn.cn
http://leaa187P.hmqwn.cn
http://xSyfDAdj.hmqwn.cn
http://rAUzCOBt.hmqwn.cn
http://heEmwtsl.hmqwn.cn
http://CPYeJLVi.hmqwn.cn
http://hiYmPue7.hmqwn.cn
http://8ACJvyQV.hmqwn.cn
http://qrdcngNR.hmqwn.cn
http://VQ7fWBBs.hmqwn.cn
http://www.dtcms.com/a/248554.html

相关文章:

  • linux thermal framework(3)_thermal cooling device
  • meshgpt 笔记2
  • java集合篇(六) ---- ListIterator 接口
  • 性能测试——搭建Prometheus+Grafana平台
  • React SSR同构渲染方案是什么?
  • RAG详解
  • 30个供应链指标与计算公式汇总,直接套用
  • 《第四章-筋骨淬炼》 C++修炼生涯笔记(基础篇)数组与函数
  • Unity 接入抖音小游戏二
  • FlashAttention:突破Transformer内存瓶颈的革命性注意力优化技术
  • 如何实现一个登录功能?
  • 一个简单的torch-cuda demo
  • 位运算详解之与或非的巧妙运用
  • 浅谈为windows7平台打包基于pyside6的UI程序
  • 音视频之H.264的句法和语义
  • 自定义线程池 4.0
  • PostgreSQL的扩展moddatetime
  • Objective-c Block 面试题
  • 一键给你的网页增加 ios26 液态玻璃效果
  • 洛谷 蜜蜂路线 高精度
  • NLP学习路线图(四十四):跨语言NLP
  • 蛋白分析工具和数据库
  • Claude Blender
  • springMVC-12 处理json和HttpMessageConverter<T>
  • 《第二章-内功筑基》 C++修炼生涯笔记(基础篇)数据类型与运算符
  • DAY 53 对抗生成网络
  • 每日算法刷题Day30 6.13:leetcode二分答案2道题,用时1h10min
  • 玩转计算机视觉——按照配置部署paddleOCR(英伟达环境与昇腾300IDUO环境)
  • java爬虫框架,简单高效,易用,附带可运行案例
  • 基于 Spring Cloud Gateway + Sentinel 实现高并发限流保护机制