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

DatePicker能否提供扩展支持非正常的日期值 #23689

Closed
1 task
xiexingen opened this issue Apr 28, 2020 · 7 comments
Closed
1 task

DatePicker能否提供扩展支持非正常的日期值 #23689

xiexingen opened this issue Apr 28, 2020 · 7 comments
Labels

Comments

@xiexingen
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

某些情况下这个日期接受的值为正常日期或者保密(NA)之类的,期望可以提供这种扩展 比如日期:2010-02-02 或者 NA NA表示这个日期是保密的,类似这种的

What does the proposed API look like?

<DatePicker externalValues=['NA'] />;

@yoyo837
Copy link
Contributor

yoyo837 commented Apr 28, 2020

format就可以了吧

@xiexingen
Copy link
Author

format一个是吧一个日期对象转成字符串,这种相当于是一个特殊值"NA"这种 他压根就不是一个日期值

@yoyo837
Copy link
Contributor

yoyo837 commented Apr 28, 2020

format 只处理显示值,持有的value仍然是日期对象。

@xiexingen
Copy link
Author

format 只处理显示值,持有的value仍然是日期对象。

所以咯,实际情况这个时候日期控件的值已经不是一个日期了;而是一个特殊值 表示不适用或者未知的这种场景,

@afc163
Copy link
Member

afc163 commented Apr 28, 2020

@xiexingen
Copy link
Author

试试 https://stackoverflow.com/questions/38953566/override-the-moment-js-default-invalid-date-text
shile试了下 值是可以进去了,但是面板里面全变成了NaN
image

@afc163
Copy link
Member

afc163 commented Oct 1, 2020

supported in #17222

@afc163 afc163 closed this as completed Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants