mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-15 17:31:25 +08:00
40 lines
974 B
TypeScript
40 lines
974 B
TypeScript
import React from 'react';
|
|
import { DatePicker, Space } from 'antd';
|
|
|
|
const { RangePicker } = DatePicker;
|
|
|
|
const App: React.FC = () => (
|
|
<Space direction="vertical" size={12}>
|
|
<DatePicker
|
|
dateRender={(current) => {
|
|
const style: React.CSSProperties = {};
|
|
if (current.date() === 1) {
|
|
style.border = '1px solid #1890ff';
|
|
style.borderRadius = '50%';
|
|
}
|
|
return (
|
|
<div className="ant-picker-cell-inner" style={style}>
|
|
{current.date()}
|
|
</div>
|
|
);
|
|
}}
|
|
/>
|
|
<RangePicker
|
|
dateRender={(current) => {
|
|
const style: React.CSSProperties = {};
|
|
if (current.date() === 1) {
|
|
style.border = '1px solid #1890ff';
|
|
style.borderRadius = '50%';
|
|
}
|
|
return (
|
|
<div className="ant-picker-cell-inner" style={style}>
|
|
{current.date()}
|
|
</div>
|
|
);
|
|
}}
|
|
/>
|
|
</Space>
|
|
);
|
|
|
|
export default App;
|