[APP-1674] Add bday fallback for app passwords (#9513)
* Add bday fallback for app passwords * Update birthdate copy, add isAppPassword handling on NoAccessScreen * Update copy * Update usage * Bump API package * HmmMMMmmm Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> * s/a/your Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> * Say hello --------- Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>
This commit is contained in:
@@ -86,3 +86,12 @@ export function isUserUnderMinimumAge(birthDate: string) {
|
||||
export function isUserUnderAdultAge(birthDate: string) {
|
||||
return getAge(new Date(birthDate)) < 18
|
||||
}
|
||||
|
||||
export function getBirthdateStringFromAge(age: number) {
|
||||
const today = new Date()
|
||||
return new Date(
|
||||
today.getFullYear() - age,
|
||||
today.getMonth(),
|
||||
today.getDate() - 1, // set to day before to ensure age is reached
|
||||
).toISOString()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user