当前位置:网站首页>Vben admin time selector related configuration and setting of unselectable time
Vben admin time selector related configuration and setting of unselectable time
2022-07-21 02:56:00 【xiaofiy】
One 、 Introduce configuration ;
component Value :
DatePicker: Date selection
RangePicker: Date range selection
format: Format of form display ,‘YYYY-MM-DD HH:mm:ss’, / ‘YYYY-MM-DD’,
valueFormat: Get worthy format ( The data format transmitted to the background )
Timestamp ’X’, Capitalization X yes 10 position , A lowercase letter x yes 13 position
‘YYYY-MM-DD HH:mm:ss’, / ‘YYYY-MM-DD’,showTime: Display the configuration of hours, minutes and seconds , Don't write, don't display, select specific hours, minutes and seconds
showTime: {
defaultValue: [moment(‘00:00:00’, ‘HH:mm:ss’), moment(‘23:59:59’, ‘HH:mm:ss’)],
},
- disabledDate Setting is not optional
- Do not choose the future time
{
label: ' Solution time ',
field: 'processTime',
component: 'DatePicker',
required: true,
componentProps: {
// The time format passed to the backend --
valueFormat: 'YYYY-MM-DD HH:mm:ss',
// Time format displayed
showTime: {
format: 'YYYY-MM-DD HH:mm:ss',
},
// Setting is not optional
disabledDate: (current) => {
// Do not choose the future time
return current && current > Date.now();
},
style: {
width: '100%',
},
},
},
design sketch :
- You cannot choose the past time
moment If there is no plug-in project, you need to download it yourself Then introduce the
import moment from 'moment';
{
label: ' Solution time ',
field: 'processTime',
component: 'DatePicker',
required: true,
componentProps: {
// The time format passed to the backend -- Timestamp 'X', Capitalization X yes 10 Bit lowercase x yes 13 position
valueFormat: 'YYYY-MM-DD HH:mm:ss',
// Time format displayed
showTime: {
format: 'YYYY-MM-DD HH:mm:ss',
},
// Setting is not optional
disabledDate: (current) => {
// You cannot choose the past time
return current < moment().add(-1, 'd');
},
style: {
width: '100%',
},
},
},
design sketch
边栏推荐
- Circuit board debugging
- [disadvantages of select and poll, and advantages of epoll]
- Silicon Valley classroom notes (Part 1)
- 【科学文献计量】中英文文献标题及摘要可读性指标分析与可视化
- [Muduo socket] InetAddress encapsulates the socket address type
- Apache Flink's yarn session submission process
- 使用renren-generator逆向生成CRUD代码
- How to configure access control in Gerrit system
- Jenkins Automated Deployment
- [flower carving experience] 20 Music Visualization: esp32_ Series attempts of C3 and ws2812b
猜你喜欢
【FAQ】接入HMS Core推送服务,服务端下发消息常见错误码原因分析及解决方法
[1000 cases of ArcGIS micro courses] 0029: ArcGIS drawing parallel lines (constructing parallel roads)
Office software cannot start normally 0xc0000142 how to solve it?
Fragment APIs are obsolete. Are you still using them?
Qualcomm and MTK customized modification method for national WiFi channel
PPT柱状图如何增加柱子
Silicon Valley classroom notes (Part 1)
Office软件无法正常启动0xc0000142怎么解决?
HMS Core图形图像技术展现最新功能和应用场景,加速构建数智生活
[AD learning record] Why are schematic diagrams and PCBs in the same folder, and PCB cannot be generated?
随机推荐
Jenkins Automated Deployment
HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
Virtual reality coexists, building a digital intelligence life | HMS core Sparkle application innovation sub forum registration launch
EF Core学习笔记:额外的外键属性 / 单项导航属性
AI2 (APP inventor 2) offline version
How to enable excel macros when they are disabled? The solution of Excel unable to enable macros
From concept to security practice: a basic guide to software supply chain
分布式笔记(05)— 分布式锁之 etcd(分布式锁原理、etcd特点、分布式锁实现方案)
混淆矩阵的计算方式
Calculate the number of days from today
Cadisplaylink, nstimer circular reference solution
Software interface and simple system simulation
STL list constructor, size
开发者必读:2022年移动应用运营增长洞察白皮书
【模板引擎】微服务学习笔记六:freemarker
Circuit board debugging
Technical dry goods | average surface distance of image segmentation based on mindspire
X.509证书(结构+原理)
[Android开发学iOS系列] 语言篇: Swift vs Kotlin
Highlight first! 2022 open atom global open source summit is scheduled to be held in Beijing on July 25-29