--- order: 12 title: zh-CN: 定制日期单元格 en-US: Customized Date Rendering --- ## zh-CN 使用 `dateRender` 可以自定义日期单元格的内容和样式。 ## en-US We can customize the rendering of date cells in the calendar by providing a `dateRender` function to `DatePicker`. ````jsx import { DatePicker } from 'antd'; const { RangePicker } = DatePicker; ReactDOM.render(
{ const style = {}; if (current.date() === 1) { style.border = '1px solid #08c'; style.borderRadius = '50%'; } return (
{current.date()}
); }} /> { const style = {}; if (current.date() === 1) { style.border = '1px solid #08c'; style.borderRadius = '50%'; } return (
{current.date()}
); }} />
, mountNode); ````