Unverified Commit b7253d1d authored by ggrund-tsi's avatar ggrund-tsi Committed by GitHub
Browse files

store birthdayformat; update personData on change (#96)


Co-authored-by: default avatarGordon Grund <gordon.grund@outlook.de>
parent 93f07e3c
......@@ -9,6 +9,7 @@ import DatePicker from "react-datepicker";
// import { registerLocale } from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import { IValueSet, useGetDateFormats } from "../../api";
import useLocalStorage from "../../misc/local-storage";
const iso3311a2 = require('iso-3166-1-alpha-2');
......@@ -140,7 +141,7 @@ export const PersonInputs = (props: any) => {
const [standardisedFamilyName, setStandardisedFamilyName] = React.useState<string>('');
const [dateOfBirth, setDateOfBirth] = React.useState<Date>();
const [dateFormat, setDateFormat] = React.useState('yyyy-MM-dd');
const [dateFormat, setDateFormat] = useLocalStorage('dateFormat', 'yyyy-MM-dd');
React.useEffect(() => {
if (props && props.eudgc && props.eudgc.nam) {
......@@ -177,7 +178,7 @@ export const PersonInputs = (props: any) => {
props.onChange(result);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [givenName, familyName, standardisedGivenName, standardisedFamilyName, dateOfBirth])
}, [givenName, familyName, standardisedGivenName, standardisedFamilyName, dateOfBirth, dateFormat])
const handleStandardisedNameChanged = (changedValue: string, setStandardisedName: (value: string) => void) => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment