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

21 lines
726 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)) as React.ClassicComponentClass<DatePickerProps>;
const MonthPicker = wrapPicker(createPicker(MonthCalendar), 'YYYY-MM');
Object.assign(DatePicker, {
2017-07-06 23:06:21 +08:00
RangePicker: wrapPicker(RangePicker),
MonthPicker,
2018-03-01 17:24:06 +08:00
WeekPicker: wrapPicker(WeekPicker, 'gggg-wo'),
});
2015-08-24 14:30:08 +08:00
export default DatePicker as DatePickerDecorator;