about summary refs log tree commit diff
path: root/src/components/dms/util.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/dms/util.ts')
-rw-r--r--src/components/dms/util.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/components/dms/util.ts b/src/components/dms/util.ts
index 5952b9acf..003532d0c 100644
--- a/src/components/dms/util.ts
+++ b/src/components/dms/util.ts
@@ -16,3 +16,12 @@ export function canBeMessaged(profile: AppBskyActorDefs.ProfileView) {
       return false
   }
 }
+
+export function localDateString(date: Date) {
+  // can't use toISOString because it should be in local time
+  const mm = date.getMonth()
+  const dd = date.getDate()
+  const yyyy = date.getFullYear()
+  // not padding with 0s because it's not necessary, it's just used for comparison
+  return `${yyyy}-${mm}-${dd}`
+}