import React, { Component } from 'react';
import hocImmutable, { imShallowEqual } from '../../utils/HOC/hocImmutable';
import { TimePicker } from 'antd';

import momentUtil from '../date-picker/momentUtil.js';

export default hocImmutable(({ format = 'HH:mm:ss', onChange, ...props }) => {
    momentUtil.parse(props, format);
    return <TimePicker {...props}
        format={format}
        onChange={(time, timeStr) => onChange && onChange(timeStr, time)}
    />
})