UNPKG

@conduction/components

Version:

React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)

11 lines (10 loc) 735 B
import { jsx as _jsx } from "react/jsx-runtime"; import "react-datepicker/dist/react-datepicker.css"; import * as styles from "./Date.module.css"; import { Controller } from "react-hook-form"; import DatePicker from "react-datepicker"; export const InputDate = ({ name, errors, control, validation, disabled, }) => { return (_jsx(Controller, { control, name, rules: validation, render: ({ field: { onChange, value } }) => { return (_jsx(DatePicker, { calendarClassName: styles.calendar, className: "denhaag-datepicker__input", onChange: (date) => onChange(date), dateFormat: "d-MM-yyyy HH:mm", timeFormat: "HH:mm", selected: value, timeIntervals: 1, showTimeSelect: true, errors, value, disabled })); } })); };