From 7637bc3f7571012b8bb4e7e20013355cbb484ec0 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 18 Jun 2024 10:13:48 -0500 Subject: [PATCH] Update comment --- src/lib/hooks/useTimeAgo.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib/hooks/useTimeAgo.ts b/src/lib/hooks/useTimeAgo.ts index a9249df8fb..5f0782f96f 100644 --- a/src/lib/hooks/useTimeAgo.ts +++ b/src/lib/hooks/useTimeAgo.ts @@ -38,9 +38,13 @@ const DAY = HOUR * 24 const MONTH_30 = DAY * 30 /** - * Returns the difference between date1 and date2 in full seconds, minutes, - * hours etc. All month are considered exactly 30 days. Assuming that date1 <= - * date2. Differences >= 360 days are returned as the "M/D/YYYY" string + * Returns the difference between `earlier` and `later` dates, formatted as a + * natural language string. + * + * - All month are considered exactly 30 days. + * - Dates assume `earlier` <= `later`, and will otherwise return 'now'. + * - Differences >= 360 days are returned as the "M/D/YYYY" string + * - All values round down */ export function dateDiff( earlier: number | string | Date,