Skip to content

Update hacker account form - change birthdate field to age field #1003

@allennatang

Description

@allennatang

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions