ant-design/components/date-picker/index.tsx
zombieJ 04111fb40e
Support date format in locale (#14340)
* use locale format

* remove monthFormat

* use locale format

* add test case
2019-01-15 16:58:40 +08:00

23 lines
741 B
TypeScript
Executable File

import * as React from 'react';
import RcCalendar from 'rc-calendar';
import MonthCalendar from 'rc-calendar/lib/MonthCalendar';
import createPicker from './createPicker';
import wrapPicker from './wrapPicker';
import RangePicker from './RangePicker';
import WeekPicker from './WeekPicker';
import { DatePickerProps, DatePickerDecorator } from './interface';
const DatePicker = wrapPicker(createPicker(RcCalendar), 'date') as React.ClassicComponentClass<
DatePickerProps
>;
const MonthPicker = wrapPicker(createPicker(MonthCalendar), 'month');
Object.assign(DatePicker, {
RangePicker: wrapPicker(RangePicker, 'date'),
MonthPicker,
WeekPicker: wrapPicker(WeekPicker, 'week'),
});
export default DatePicker as DatePickerDecorator;