Overview
In the hacker account form, change the birthdate field to age field. Validate that it is between 0 and 100. Allow users to edit their age field after account creation.
Technical Details
-
Replace all mentions "birthDate" with "age"
-
Remove conversions of input to date
- Ex: In
const convertFormikToAccount = (, changed birthDate: input2date(values.birthDate), to age: values.age,
-
For the front-end form, in dashboard\src\features\Account\ManageAccountForm.tsx:
- Change
format="##/##/####" to format="##" to match a 2-digit age
- Remove
placeholder="MM/DD/YYYY"
- Remove
disabled={props.mode === ManageAccountModes.EDIT} since without a function to update age based on birth date, age may need to be edited by user.
-
Change validation of the field in dashboard\src\features\Account\validationSchema.ts
- Change type from
birthDate: string() to age: number()
- Validate that age is between 0 and 100
Overview
In the hacker account form, change the birthdate field to age field. Validate that it is between 0 and 100. Allow users to edit their age field after account creation.
Technical Details
Replace all mentions "birthDate" with "age"
Remove conversions of input to date
const convertFormikToAccount = (, changedbirthDate: input2date(values.birthDate),toage: values.age,For the front-end form, in
dashboard\src\features\Account\ManageAccountForm.tsx:format="##/##/####"toformat="##"to match a 2-digit ageplaceholder="MM/DD/YYYY"disabled={props.mode === ManageAccountModes.EDIT}since without a function to update age based on birth date, age may need to be edited by user.Change validation of the field in
dashboard\src\features\Account\validationSchema.tsbirthDate: string()toage: number()