Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support start time or end time could be null in defaultValue #520

Merged
merged 4 commits into from
Mar 16, 2019

Conversation

ztplz
Copy link
Contributor

@ztplz ztplz commented Feb 27, 2019

ant-design/ant-design#14761
ant-design/ant-design#13433

start tiime是null的时候,range的范围是到end time为止
end time是null的时候,range的范围是从 start time开始

@ant-design-bot
Copy link

ant-design-bot commented Feb 27, 2019

Deploy preview for rc-calendar failed.

Built with commit 2a0560f

https://app.netlify.com/sites/rc-calendar/deploys/5c8baac8ff7f0f00085b05ef

@ztplz
Copy link
Contributor Author

ztplz commented Feb 27, 2019

@afc163 @zombieJ

@afc163
Copy link
Member

afc163 commented Feb 27, 2019

支持一下 undefined 吧。

@codecov
Copy link

codecov bot commented Feb 27, 2019

Codecov Report

Merging #520 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/RangeCalendar.js 87.4% <100%> (+0.13%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 720f127...2a0560f. Read the comment docs.

@ztplz
Copy link
Contributor Author

ztplz commented Feb 27, 2019

Done.

@zombieJ
Copy link
Member

zombieJ commented Feb 27, 2019

突然想到一个问题,用户选择范围后,想再变回 null 怎么操作?

@ztplz
Copy link
Contributor Author

ztplz commented Feb 28, 2019

原来也不支持变defaultValue吧

@zombieJ
Copy link
Member

zombieJ commented Feb 28, 2019

原本的范围是从无到有,现在支持 half value 后应该也允许用户设置 half value,这样行为才一致,否则有些怪异……觉得呢?

@ztplz
Copy link
Contributor Author

ztplz commented Feb 28, 2019

我测试下原来的behavior

@ztplz
Copy link
Contributor Author

ztplz commented Feb 28, 2019

原来也是不支持动态更改defaultValue的

@zombieJ
Copy link
Member

zombieJ commented Feb 28, 2019

不是修改 defaultValue 哈。我指的是,antd 中,无值可以通过 clear button 点出来,有值通过范围选择点出来。但是半个值的状态是从用户角度无法点出来的。这个就会比较蛋疼,因为如果存在用户要写从 xxx 至今的日期范围。我们还是缺了这一步。

@ztplz
Copy link
Contributor Author

ztplz commented Mar 1, 2019

image
那左边也要加个清除按钮 要两个按钮了 一个清开始的 一个清结束的

@ztplz
Copy link
Contributor Author

ztplz commented Mar 1, 2019

image
现在它会把两个都清掉

@zombieJ
Copy link
Member

zombieJ commented Mar 2, 2019

感觉有点点别扭。@afc163 你觉得这个交互上怎么样?

@afc163
Copy link
Member

afc163 commented Mar 2, 2019

可以先不支持好了,一般的需求是写死开始值或者写死结束值,保证写死的值无法被 UI 修改就行了,这样也不需要手动清空了。

@zombieJ zombieJ merged commit deb7c95 into react-component:master Mar 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants