[APP-615] COPPA-compliant signup (#570)

* Rework account creation to be COPPA compliant

* Fix lint

* Switch android datepicker to use the spinner mode

* Fix type signatures & usages
This commit is contained in:
Paul Frazee 2023-05-08 17:25:57 -05:00 committed by GitHub
parent cdfb1c7abf
commit 7a176b3fdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 254 additions and 52 deletions

View file

@ -39,3 +39,13 @@ export function niceDate(date: number | string | Date) {
minute: '2-digit',
})}`
}
export function getAge(birthDate: Date): number {
var today = new Date()
var age = today.getFullYear() - birthDate.getFullYear()
var m = today.getMonth() - birthDate.getMonth()
if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
age--
}
return age
}