import * as React from 'react'; import * as ReactDOM from 'react-dom'; import DatePicker from '../../lib/date-picker'; import { getTodayDate, isDayInDateRange, dateStrignFormatDatePickerValue } from '../../lib/util/date'; class Demo extends React.Component { constructor(props: any, state: any) { super(props, state); } public componentDidMount(): void { setTimeout(() => { this.setState({ visible: true }); }, 300); console.log(isDayInDateRange('prevMonth', '2017-04-02 00: 00', '2017-04-08 00:00')); } /** * 获取时间默认值 */ public getDefaultValue(): any[] { return dateStrignFormatDatePickerValue(getTodayDate('yy-MM-dd HH:mm', 'string'), 'yy-MM-dd HH:mm'); } /** * 字符串转换为数组 */ public getTodayArray(): string[] { return getTodayDate('yy-MM-dd HH:mm', 'array'); } public render(): JSX.Element { return (
); } } ReactDOM.render(, document.getElementById('root'));