aboutsummaryrefslogtreecommitdiff
path: root/src/util.ts
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2024-01-25 20:09:56 -0500
committerAndrew Lee <alee14498@protonmail.com>2024-01-25 20:09:56 -0500
commited2c9768a0471d11a0b87a5514dcbf387ebbf8f7 (patch)
tree3ffd02b87699b8e5b2a48ebbd8c9df16466f8f3e /src/util.ts
parent162e303beeb5f2987852b543805fb6243a4ae725 (diff)
downloadpersonal-website-ed2c9768a0471d11a0b87a5514dcbf387ebbf8f7.tar.gz
personal-website-ed2c9768a0471d11a0b87a5514dcbf387ebbf8f7.tar.bz2
personal-website-ed2c9768a0471d11a0b87a5514dcbf387ebbf8f7.zip
Markdown cb style; Fixed chrome-only issue; Format date on blog
Diffstat (limited to 'src/util.ts')
-rw-r--r--src/util.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util.ts b/src/util.ts
new file mode 100644
index 0000000..f7f9018
--- /dev/null
+++ b/src/util.ts
@@ -0,0 +1,8 @@
+// Format date to a string
+function formatDate(date: Date): string {
+ const options: Intl.DateTimeFormatOptions = { year: 'numeric', month: 'long', day: 'numeric' };
+
+ return new Date(date).toLocaleDateString(undefined, options);
+}
+
+export { formatDate }