2023-05-18 16:12:41 +08:00
|
|
|
import React from 'react';
|
2023-07-28 16:17:43 +08:00
|
|
|
import { Calendar, ConfigProvider } from 'antd';
|
2023-08-17 17:12:51 +08:00
|
|
|
import type { CalendarProps } from 'antd';
|
2024-04-08 14:04:08 +08:00
|
|
|
import type { Dayjs } from 'dayjs';
|
2023-05-18 16:12:41 +08:00
|
|
|
|
|
|
|
/** Test usage. Do not use in your production. */
|
|
|
|
export default () => {
|
2023-08-17 17:12:51 +08:00
|
|
|
const onPanelChange = (value: Dayjs, mode: CalendarProps<Dayjs>['mode']) => {
|
2023-05-18 16:12:41 +08:00
|
|
|
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>
|
|
|
|
);
|
|
|
|
};
|