ant-design/components/date-picker/index.tsx

23 lines
741 B
TypeScript
Raw Normal View History

import * as React from 'react';
import RcCalendar from 'rc-calendar';
2015-10-20 16:47:55 +08:00
import MonthCalendar from 'rc-calendar/lib/MonthCalendar';
2016-03-30 09:50:44 +08:00
import createPicker from './createPicker';
2016-03-30 10:52:15 +08:00
import wrapPicker from './wrapPicker';
import RangePicker from './RangePicker';
import WeekPicker from './WeekPicker';
2018-01-19 19:06:19 +08:00
import { DatePickerProps, DatePickerDecorator } from './interface';
2015-08-25 17:27:38 +08:00
const DatePicker = wrapPicker(createPicker(RcCalendar), 'date') as React.ClassicComponentClass<
2018-12-07 20:02:01 +08:00
DatePickerProps
>;
const MonthPicker = wrapPicker(createPicker(MonthCalendar), 'month');
Object.assign(DatePicker, {
RangePicker: wrapPicker(RangePicker, 'date'),
MonthPicker,
WeekPicker: wrapPicker(WeekPicker, 'week'),
});
2015-08-24 14:30:08 +08:00
export default DatePicker as DatePickerDecorator;