NG-ZORRO / ng-zorro-antd

Angular UI Component Library based on Ant Design
https://ng.ant.design
MIT License
8.86k stars 3.91k forks source link

date-range-picker,右边的时间可以比左边早 #6972

Closed yunyuyuan closed 3 years ago

yunyuyuan commented 3 years ago

Reproduction link

https://github.com/NG-ZORRO/ng-zorro-antd

Steps to reproduce

你们的官网,https://ng.ant.design/components/date-picker/zh#components-date-picker-demo-extra-footer。倒数第二个选择,时分秒那个,左边选择2021.09.08 13:50:50,右边选择2021.09.08 13:49:50,点击确定后没有报错或者自动清空。

What is expected?

右边的时间不能比左边早

What is actually happening?

右边的时间能比左边早

Environment Info
ng-zorro-antd 12.0.1
Browser Edge
zorro-bot[bot] commented 3 years ago

Translation of this issue:

Data-Range-Picker, the time on the right can be higher than the left

reproduction link

https://github.com/ng- zorro/ng-zorro-antd

steps to reproduce

Your official website, https: //ng.ant.design/components/date-picker/en#components-date-picker-demo-extra-footer. The second selection time is second, and the left side selection 2021.09.08 13:50:50, the right side selection 2021.09.08 13:49:50, no error or clear

What is expected?

The time on the right cannot be higher than the left.

What is actually happens?

The time on the right can be higher than the left.

ENVIRONMENT INFO
Ng-Zorro-ANTD 12.0.1
Browser Edge
simplejason commented 3 years ago

You can use the nzDisabledTime property to do this, please check this demo: https://ng.ant.design/components/date-picker/zh#components-date-picker-demo-disabled-date

yunyuyuan commented 3 years ago

You can use the nzDisabledTime property to do this, please check this demo: https://ng.ant.design/components/date-picker/zh#components-date-picker-demo-disabled-date

Thanks!

jifengmm commented 2 years ago

You can use the nzDisabledTime property to do this, please check this demo: https://ng.ant.design/components/date-picker/zh#components-date-picker-demo-disabled-date

Thanks!

这个是静态的,写死的。如何动态控制后面的日期加时间大于前面的日期加时间。 disabledtime无法在日期选择panel打开的状态下,当用户切换日期时再次计算并且重新渲染打开中的panel。 而且存在当后面的日期小于前面的日期时,控件会自动交换前后日期的行为,disabledtime更加不好起作用。