aboutsummaryrefslogtreecommitdiff
path: root/src/util.ts
diff options
context:
space:
mode:
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 }