Support start time or end time could be null in defaultValue#520
Support start time or end time could be null in defaultValue#520zombieJ merged 4 commits intoreact-component:masterfrom
Conversation
|
Deploy preview for rc-calendar failed. Built with commit 2a0560f https://app.netlify.com/sites/rc-calendar/deploys/5c8baac8ff7f0f00085b05ef |
|
支持一下 |
Codecov Report
@@ Coverage Diff @@
## master #520 +/- ##
==========================================
+ Coverage 89.37% 89.43% +0.06%
==========================================
Files 10 10
Lines 687 691 +4
Branches 197 199 +2
==========================================
+ Hits 614 618 +4
Misses 63 63
Partials 10 10
Continue to review full report at Codecov.
|
|
Done. |
|
突然想到一个问题,用户选择范围后,想再变回 null 怎么操作? |
|
原来也不支持变defaultValue吧 |
|
原本的范围是从无到有,现在支持 half value 后应该也允许用户设置 half value,这样行为才一致,否则有些怪异……觉得呢? |
|
我测试下原来的behavior |
|
原来也是不支持动态更改defaultValue的 |
|
不是修改 defaultValue 哈。我指的是,antd 中,无值可以通过 clear button 点出来,有值通过范围选择点出来。但是半个值的状态是从用户角度无法点出来的。这个就会比较蛋疼,因为如果存在用户要写从 xxx 至今的日期范围。我们还是缺了这一步。 |
|
感觉有点点别扭。@afc163 你觉得这个交互上怎么样? |
|
可以先不支持好了,一般的需求是写死开始值或者写死结束值,保证写死的值无法被 UI 修改就行了,这样也不需要手动清空了。 |


ant-design/ant-design#14761
ant-design/ant-design#13433
start tiime是null的时候,range的范围是到end time为止
end time是null的时候,range的范围是从 start time开始