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暴露更多的API和属性。 #28079

Closed
1 task
xiaochunyu opened this issue Nov 30, 2020 · 3 comments
Closed
1 task

可不可以DatePicker暴露更多的API和属性。 #28079

xiaochunyu opened this issue Nov 30, 2020 · 3 comments
Labels

Comments

@xiaochunyu
Copy link

xiaochunyu commented Nov 30, 2020

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

What problem does this feature solve?

日历对于周六周日加入自定义样式,需要周标题栏和日期都可以自定义,并且自定义样式只能在当前面板月份的周六周日有效。

下面有个通过样式表实现的方案:
(https://codesandbox.io/s/antd-reproduction-template-forked-etndm?file=/index.js)

What does the proposed API look like?

dateRender函数加入currentMonth(当前面板主月份)参数:
dateRender = (currentDate: moment, today: moment, currentMonth) =>{}

期望有日期标题的自定义函数如:
dateTitleRender = (current) => {}

@afc163
Copy link
Member

afc163 commented Dec 1, 2020

@xiaochunyu
Copy link
Author

其实,dateRender函数最好能暴露出当前面板的月份参数,这样就可以做到只是当前面板月的周六周日自定义样式。
如下:currentMonth:为当前面板的主月份

dateRender = (currentDate: moment, today: moment, currentMonth) => {}
我使用样式表实现的效果

@afc163
Copy link
Member

afc163 commented Dec 2, 2020

已经有 today 了,你可以算出 currentMonth 的。

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

3 participants