mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-01 14:59:35 +08:00
27 lines
672 B
TypeScript
27 lines
672 B
TypeScript
import { Calendar, theme } from 'antd';
|
|
import type { CalendarMode } from 'antd/es/calendar/generateCalendar';
|
|
import type { Dayjs } from 'dayjs';
|
|
import React from 'react';
|
|
|
|
const onPanelChange = (value: Dayjs, mode: CalendarMode) => {
|
|
console.log(value.format('YYYY-MM-DD'), mode);
|
|
};
|
|
|
|
const App: React.FC = () => {
|
|
const { token } = theme.useToken();
|
|
|
|
const wrapperStyle: React.CSSProperties = {
|
|
width: 300,
|
|
border: `1px solid ${token.colorBorderSecondary}`,
|
|
borderRadius: token.borderRadiusLG,
|
|
};
|
|
|
|
return (
|
|
<div style={wrapperStyle}>
|
|
<Calendar fullscreen={false} onPanelChange={onPanelChange} />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default App;
|