mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 05:28:20 +08:00
f3c1871b20
* chore: bump rc-picker * Update package.json * Update cell-render.tsx --------- Co-authored-by: 二货爱吃白萝卜 <smith3816@gmail.com> Co-authored-by: lijianan <574980606@qq.com>
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
import React from 'react';
|
|
import { DatePicker, Space } from 'antd';
|
|
|
|
const { RangePicker } = DatePicker;
|
|
|
|
const App: React.FC = () => (
|
|
<Space direction="vertical" size={12}>
|
|
<DatePicker
|
|
cellRender={(current, info) => {
|
|
if (info.type !== 'date') return info.originNode;
|
|
if (typeof current === 'number') {
|
|
return <div className="ant-picker-cell-inner">{current}</div>;
|
|
}
|
|
return (
|
|
<div
|
|
className="ant-picker-cell-inner"
|
|
style={current.date() === 1 ? { border: '1px solid #1677ff', borderRadius: '50%' } : {}}
|
|
>
|
|
{current.date()}
|
|
</div>
|
|
);
|
|
}}
|
|
/>
|
|
<RangePicker
|
|
cellRender={(current, info) => {
|
|
if (info.type !== 'date') return info.originNode;
|
|
if (typeof current === 'number') {
|
|
return <div className="ant-picker-cell-inner">{current}</div>;
|
|
}
|
|
return (
|
|
<div
|
|
className="ant-picker-cell-inner"
|
|
style={current.date() === 1 ? { border: '1px solid #1677ff', borderRadius: '50%' } : {}}
|
|
>
|
|
{current.date()}
|
|
</div>
|
|
);
|
|
}}
|
|
/>
|
|
</Space>
|
|
);
|
|
|
|
export default App;
|