Skip to content

Commit

Permalink
fixes per comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ducica committed Mar 1, 2024
1 parent ab73f5d commit bac143c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ export const InputElement = forwardRef(
ref
) => {
const { errors } = useFormikContext();
const inputError = getIn(errors, fieldPath, "");
const inputError = getIn(errors, fieldPath, undefined);
return (
<Form.Input
// need to explicitly set it as undefined, because otherwise it shows empty errors
// attached to the input
error={inputError ? inputError : undefined}
error={inputError}
onClick={onClick}
onKeyDown={onKeyDown}
label={label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const allEmptyStrings = (arr) => arr.every((element) => element === "");
export const serializeDate = (dateObj, dateEdtfFormat) => {
if (dateObj === null) return "";

if (dateEdtfFormat === "yyyy") return `${dateObj.getFullYear()}`;
if (dateEdtfFormat === "yyyy") return dateObj.getFullYear();
if (dateEdtfFormat === "yyyy-mm")
return `${dateObj.getFullYear()}-${_padStart(
dateObj.getMonth() + 1,
Expand Down

0 comments on commit bac143c

Please sign in to comment.