diff options
author | Eric Bailey <git@esb.lol> | 2024-06-18 17:21:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-18 17:21:34 -0500 |
commit | 32b40631851c3c3f5ae2400c4bb89e009e71a9da (patch) | |
tree | 810af1880e2fddf1753c2d397b49aafe41148078 /src/lib/strings | |
parent | 853c32b4d8cfe86ed02c688c32fc99e788c33838 (diff) | |
download | voidsky-32b40631851c3c3f5ae2400c4bb89e009e71a9da.tar.zst |
Verify email reminders (#4510)
* Clarify intent * Increase email reminder period to once per day * Fallback * Snooze immediately after account creation, prevent showing right after signup * Fix e2e test exports * Remove redundant check * Better simple date generation * Replace in DateField * Use non-string comparison * Revert change to unrelated code * Also parse * Remove side effect
Diffstat (limited to 'src/lib/strings')
-rw-r--r-- | src/lib/strings/time.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/strings/time.ts b/src/lib/strings/time.ts index 1194e0240..bfefea9bc 100644 --- a/src/lib/strings/time.ts +++ b/src/lib/strings/time.ts @@ -19,3 +19,14 @@ export function getAge(birthDate: Date): number { } return age } + +/** + * Compares two dates by year, month, and day only + */ +export function simpleAreDatesEqual(a: Date, b: Date): boolean { + return ( + a.getFullYear() === b.getFullYear() && + a.getMonth() === b.getMonth() && + a.getDate() === b.getDate() + ) +} |