forked from ddrilling/asb_cloud_front
DatePickerWrapper переписан на TSX
This commit is contained in:
parent
494fd8128c
commit
4afa7810ff
@ -1,13 +0,0 @@
|
||||
import { DatePicker } from "antd"
|
||||
import moment from "moment"
|
||||
import {formatDate} from './index'
|
||||
|
||||
export const DatePickerWrapper = ({value, onChange, ...other}) => (<DatePicker
|
||||
allowClear={false}
|
||||
defaultValue={moment()}
|
||||
value={moment.utc(value).local()}
|
||||
format={formatDate}
|
||||
showTime
|
||||
onChange={(date) => onChange(date)}
|
||||
{...other}
|
||||
/>)
|
23
src/components/Table/DatePickerWrapper.tsx
Normal file
23
src/components/Table/DatePickerWrapper.tsx
Normal file
@ -0,0 +1,23 @@
|
||||
import { DatePicker } from 'antd'
|
||||
import moment from 'moment'
|
||||
import { formatDate } from './index'
|
||||
|
||||
export type DatePickerWrapperProps = {
|
||||
value: moment.Moment,
|
||||
onChange: (date: moment.Moment | null) => any
|
||||
[other: string]: any
|
||||
}
|
||||
|
||||
export const DatePickerWrapper: React.FC<DatePickerWrapperProps> = ({value, onChange, ...other}) => (
|
||||
<DatePicker
|
||||
allowClear={false}
|
||||
defaultValue={moment()}
|
||||
value={moment.utc(value).local()}
|
||||
format={formatDate}
|
||||
showTime
|
||||
onChange={(date) => onChange(date)}
|
||||
{...other}
|
||||
/>
|
||||
)
|
||||
|
||||
export default DatePickerWrapper
|
Loading…
Reference in New Issue
Block a user