···44import {useLingui} from '@lingui/react'
5566import {cleanError} from '#/lib/strings/errors'
77+import {getDateAgo} from '#/lib/strings/time'
78import {logger} from '#/logger'
89import {isIOS, isWeb} from '#/platform/detection'
910import {
···101102 onChangeDate={newDate => setDate(new Date(newDate))}
102103 label={_(msg`Birthday`)}
103104 accessibilityHint={_(msg`Enter your birth date`)}
104104- maximumDate={new Date()}
105105+ maximumDate={getDateAgo(13)}
105106 />
106107 </View>
107108
+11
src/lib/strings/time.ts
···2020}
21212222/**
2323+ * Get a Date object that is N years ago from now
2424+ * @param years number of years
2525+ * @returns Date object
2626+ */
2727+export function getDateAgo(years: number): Date {
2828+ const date = new Date()
2929+ date.setFullYear(date.getFullYear() - years)
3030+ return date
3131+}
3232+3333+/**
2334 * Compares two dates by year, month, and day only
2435 */
2536export function simpleAreDatesEqual(a: Date, b: Date): boolean {