mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 01:19:45 +08:00
f1c38bf9e0
* feat: update demo * feat: update demo * feat: update demo * feat: update demo * feat: optimize code * feat: optimize code * feat: optimize code * feat: optimize code * feat: optimize code * feat: optimize code * feat: optimize code
30 lines
751 B
TypeScript
30 lines
751 B
TypeScript
import type { Dayjs } from 'dayjs';
|
|
import React from 'react';
|
|
import { Calendar, ConfigProvider } from 'antd';
|
|
import type { CalendarProps } from 'antd';
|
|
|
|
/** Test usage. Do not use in your production. */
|
|
export default () => {
|
|
const onPanelChange = (value: Dayjs, mode: CalendarProps<Dayjs>['mode']) => {
|
|
console.log(value.format('YYYY-MM-DD'), mode);
|
|
};
|
|
|
|
return (
|
|
<ConfigProvider
|
|
theme={{
|
|
components: {
|
|
Calendar: {
|
|
fullBg: 'red',
|
|
fullPanelBg: 'green',
|
|
itemActiveBg: 'black',
|
|
},
|
|
},
|
|
}}
|
|
>
|
|
<Calendar onPanelChange={onPanelChange} />
|
|
<br />
|
|
<Calendar onPanelChange={onPanelChange} fullscreen={false} />
|
|
</ConfigProvider>
|
|
);
|
|
};
|