当前位置:网站首页>Configure ng
Configure ng
2020-11-09 19:13:00 【Irving the procedural ape】
1、 The official sample nz-date-picker
The effect achieved in the official example cannot meet the requirements of business query , such as : I need to select the start time first , Then when you select the end time, you cannot select the data of the same date , And even if you choose “ At the moment ” when , The corresponding time is not disabled
explain :ng-zerro There is a corresponding implementation , But in the example, it's relatively simple , It's not going to work , This paper only makes its own implementation record 
2、 How to achieve can choose the same time , And disable the time that is not in the selected time range
Such as : Starting time 2020-11-09 12:12:12, The end time needs to be selected 2020-11-09 12:12:12, And less than 2020-11-09 12:12:12 Time to disable
html Realization :
<nz-date-picker [nzDisabledTime]="disabledStartTime" [nzDisabledDate]="disabledStartDate" nzShowTime nzFormat="yyyy-MM-dd HH:mm:ss" [(ngModel)]="startValue" nzPlaceHolder=" Starting time " (ngModelChange)="onStartChange($event)" > </nz-date-picker> <nz-date-picker [nzDisabledTime]="disabledEndTime" [nzDisabledDate]="disabledEndDate" nzShowTime nzFormat="yyyy-MM-dd HH:mm:ss" [(ngModel)]="endValue" nzPlaceHolder=" End time " (ngModelChange)="onEndChange($event)" > </nz-date-picker>
ts Realization :
// Configure the date disabledStartDate = (startValue: Date): boolean => { if (!startValue || !this.endValue) { return false; } // At the same time, you can choose if (startValue.getTime() === this.endValue.getTime()){ return false; } return startValue.getTime() >= this.endValue.getTime();}disabledEndDate = (endValue: Date): boolean => { if (!endValue || !this.startValue) { return false; } if (endValue.getDate() === this.startValue.getDate()) { // Do not disable the same date return false; }else{ // At the same time, you can choose return endValue.getTime() <= this.startValue.getTime(); }}// Disable time disabledStartTime: DisabledTimeFn = (_value: Date, type?: DisabledTimePartial) => { // Set the start time if (!this.endValue){ return null; } if (!_value){ _value = this.endValue; } let disableMinutes = []; let disableS.........
版权声明
本文为[Irving the procedural ape]所创,转载请带上原文链接,感谢
边栏推荐
- 如何用代码上传头像,并添加自己的版权信息?
- 百亿级数据分表后怎么分页查询?
- Hot update scheme of Chrome extension program: 2. Based on double cache update function module
- 高性能库DPDK精简理解
- 【云小课】版本管理发展史之Git+——代码托管
- How the API gateway carries the API economic ecological chain
- JT-day10
- Four solutions of Android soft keyboard occlusion
- 迅为IMX6ULL开发板C程序调用shell
- Share tips on editing letters and mathematical formulas with MathType
猜你喜欢

修改jar包里的文件

Numeric keyboard with decimal point in IOS

Flink的安装部署

Nine kinds of distributed primary key ID generation schemes of sub database and sub table are quite comprehensive

云数据库的本质是什么?探究华为云数据库的核心价值

RBAC of kubernetes authority management (1)

How the API gateway carries the API economic ecological chain

day83:luffy:添加购物车&导航栏购物车数字显示&购物车页面展示

如何使用RTSP推流组件EasyPusher将MP4文件推到EasyDarwin开源平台?

迅为IMX6ULL开发板C程序调用shell
随机推荐
Hand in hand to teach you to use container service tke cluster audit troubleshooting
How to realize the authority route and authority menu of background management system
andorid实例-简单登录布局
JT-day10
Chrome扩展程序热更新方案:2.基于双缓存更新功能模块
60 余位技术高管齐聚松山湖,华为云第一期核心伙伴开发者训练营圆满落幕
如何优雅阻止view UI 的 Switch 切换?
Super low price cloud server is coming
小程序调用原生onShareAppMessage分享,imageUrl参数是mp4格式怎么办
GPS timing system (network timing instrument) application of e-government system
配置ng-zerro的nz-date-picker时间选择组件
数据库执行truncate table CM_CHECK_ITEM_HIS怎么恢复
How the API gateway carries the API economic ecological chain
[invite you to vote] who is the key driver behind these big open source events in 2020?
RBAC of kubernetes authority management (1)
dat.GUI 打造可视化工具(一)
Git + -- Code hosting in the history of version management
From master of Engineering Physics of Tsinghua University to open source entrepreneur of cloud computing
Almost finished all the list titles, I found these things...
浅谈API网关(API Gateway)如何承载API经济生态链