From dd47be1bc65d3a8050d6ce9e77cd0e3b10e2a1a9 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sat, 19 Aug 2023 23:28:44 +0000
Subject: [PATCH] improve path resolution stability
---
quartz/components/Date.tsx | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/quartz/components/Date.tsx b/quartz/components/Date.tsx
index 7ea6ad4..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'
+ day: "2-digit",
})
- return <>{formattedDate}</>
+}
+
+export function Date({ date }: Props) {
+ return <>{formatDate(date)}</>
}
--
Gitblit v1.10.0