diff --git a/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/select/Select.tsx b/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/select/Select.tsx index 0a68d98fde..6ad76db1ff 100644 --- a/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/select/Select.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/select/Select.tsx @@ -200,7 +200,8 @@ const P_FormSelect = ({ feil, ...props }: SelectProps) => { (errorContext?.showError || isTouched) && (feil || formMethods?.getFieldState(props.name)?.error || - formMethods?.getFieldState(props.fieldName)?.error) + formMethods?.getFieldState(props.fieldName)?.error || + formMethods?.getFieldState(`manual.${props.name}`)?.error) } {...props} /> diff --git a/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/textInput/TextInput.tsx b/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/textInput/TextInput.tsx index 047c8053ed..8fedcffbfd 100644 --- a/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/textInput/TextInput.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/textInput/TextInput.tsx @@ -94,7 +94,10 @@ export const TextInput = React.forwardRef( const input = props.input || props.value const [fieldValue, setFieldValue] = useState(props.input || watch(name) || '') const isTouched = _.has(touchedFields, name) || _.has(touchedFields, fieldName) - const feil = getFieldState(name)?.error || getFieldState(fieldName)?.error + const feil = + getFieldState(name)?.error || + getFieldState(fieldName)?.error || + getFieldState(`manual.${name}`)?.error const visFeil = feil && (errorContext?.showError || isTouched) const css = cn('skjemaelement__input', className, { 'skjemaelement__input--harFeil': visFeil, diff --git a/apps/dolly-frontend/src/main/js/src/utils/DataFormatter.tsx b/apps/dolly-frontend/src/main/js/src/utils/DataFormatter.tsx index e3e6ba6f57..a7a3ef6d55 100644 --- a/apps/dolly-frontend/src/main/js/src/utils/DataFormatter.tsx +++ b/apps/dolly-frontend/src/main/js/src/utils/DataFormatter.tsx @@ -30,6 +30,9 @@ export const formatDate = (date: any, formatString?: string) => { if (!date) { return date } + if (date?.length > 19) { + date = date.substring(0, 19) + } if (isDate(date)) { const customdayjs = initDayjs() return customdayjs(date).format(formatString || 'DD.MM.YYYY')