From e21f0f9bb97cbc4bd59f6bce0e0fce451b6d2b01 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Wed, 09 Aug 2023 04:28:09 +0000
Subject: [PATCH] change reading time to content meta

---
 quartz/components/Date.tsx |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/quartz/components/Date.tsx b/quartz/components/Date.tsx
index 16c4544..f4b284a 100644
--- a/quartz/components/Date.tsx
+++ b/quartz/components/Date.tsx
@@ -2,11 +2,14 @@
   date: Date
 }
 
-export function Date({ date }: Props) {
-  const formattedDate = date.toLocaleDateString("en-US", {
+export function formatDate(d: Date): string {
+  return d.toLocaleDateString("en-US", {
     year: "numeric",
     month: "short",
     day: "2-digit",
   })
-  return <>{formattedDate}</>
+}
+
+export function Date({ date }: Props) {
+  return <>{formatDate(date)}</>
 }

--
Gitblit v1.10.0