From bac143cbbedaaa6db1609b0544cdcc3c3eb7d641 Mon Sep 17 00:00:00 2001 From: ducica Date: Fri, 1 Mar 2024 11:05:54 +0100 Subject: [PATCH] fixes per comments --- .../forms/components/EDTFDatePickerField/InputElement.jsx | 6 ++---- .../oarepo_ui/forms/components/EDTFDatePickerField/utils.js | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/InputElement.jsx b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/InputElement.jsx index f11d582d..ef407f5e 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/InputElement.jsx +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/InputElement.jsx @@ -19,12 +19,10 @@ export const InputElement = forwardRef( ref ) => { const { errors } = useFormikContext(); - const inputError = getIn(errors, fieldPath, ""); + const inputError = getIn(errors, fieldPath, undefined); return ( 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,