import React from 'react';
import './InputDate.css'
import {format} from "date-fns";

export function InputDate({children, value, onChange, name}: any) {
    return (
        <>
            <label htmlFor={name}>{children}</label>
            <input type="date" value={value ? format(value, "yyyy-MM-dd") : ''} name={name} onChange={onChange}
                   className="input__date"/>
        </>
    );
}
