Skip to content

Commit

Permalink
refactor(web/input): add icon to date picker
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeWasTakenn committed Jan 14, 2023
1 parent ec57d03 commit a23b94c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions web/src/features/dialog/components/fields/date.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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}
/>
Expand Down
1 change: 1 addition & 0 deletions web/src/interfaces/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,5 @@ export interface IDateInput {
clearable?: boolean;
min?: string;
max?: string;
icon?: IconProp;
}

0 comments on commit a23b94c

Please sign in to comment.