[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:
parent
cdfb1c7abf
commit
7a176b3fdf
10 changed files with 254 additions and 52 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue