refactor(web/input): add icon to date picker

This commit is contained in:
Luke
2023-01-14 13:56:05 +01:00
parent ec57d03791
commit a23b94ceb1
2 changed files with 3 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ import { IDateInput } from '../../../../interfaces/dialog';
import { Control, useController } from 'react-hook-form';
import { FormValues } from '../../InputDialog';
import { DatePicker } from '@mantine/dates';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
interface Props {
row: IDateInput;
@@ -31,6 +32,7 @@ const DateField: React.FC<Props> = (props) => {
inputFormat="DD/MM/YYYY"
withAsterisk={props.row.required}
clearable={props.row.clearable}
icon={props.row.icon && <FontAwesomeIcon fixedWidth icon={props.row.icon} />}
minDate={props.row.min ? new Date(props.row.min) : undefined}
maxDate={props.row.max ? new Date(props.row.max) : undefined}
/>