diff options
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() + ) +} |