about summary refs log tree commit diff
path: root/bskyembed/src/util/nice-date.ts
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2025-08-26 18:24:46 +0300
committerGitHub <noreply@github.com>2025-08-26 08:24:46 -0700
commitb70e5b2f387e8de6dac5d388aee1ccbf5b217adc (patch)
treee540d731ec004e58e1280c6382b00b6947d03e63 /bskyembed/src/util/nice-date.ts
parent5a074fa37acafb0cf11acbdd0a931411b1c63aa2 (diff)
downloadvoidsky-b70e5b2f387e8de6dac5d388aee1ccbf5b217adc.tar.zst
Add verification checkmarks to `embed.bsky.app` (#8644)
* update vite+typescript

* update atproto api to latest, split out utils

* add checkmark to post

* add checkie to embed

* revert change to example post

* fix ext link color
Diffstat (limited to 'bskyembed/src/util/nice-date.ts')
-rw-r--r--bskyembed/src/util/nice-date.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/bskyembed/src/util/nice-date.ts b/bskyembed/src/util/nice-date.ts
new file mode 100644
index 000000000..016c97a69
--- /dev/null
+++ b/bskyembed/src/util/nice-date.ts
@@ -0,0 +1,11 @@
+export function niceDate(date: number | string | Date) {
+  const d = new Date(date)
+  return `${d.toLocaleDateString('en-us', {
+    year: 'numeric',
+    month: 'short',
+    day: 'numeric',
+  })} at ${d.toLocaleTimeString(undefined, {
+    hour: 'numeric',
+    minute: '2-digit',
+  })}`
+}