···11+const ONE_DAY = 1000 * 60 * 60 * 24
22+33+export function isDaysOld(days: number, createdAt?: string) {
44+ /*
55+ * Should never happen because we gate NUXs to only accounts with a valid
66+ * profile and a `createdAt` (see `nuxs/index.tsx`). But if it ever did, the
77+ * account is either old enough to be pre-onboarding, or some failure happened
88+ * during account creation. Fail closed. - esb
99+ */
1010+ if (!createdAt) return false
1111+1212+ const now = Date.now()
1313+ const then = new Date(createdAt).getTime()
1414+ const isOldEnough = then + ONE_DAY * days < now
1515+1616+ if (isOldEnough) return true
1717+ return false
1818+}