From afab936d708ad3d6014789326f3143d642db74f7 Mon Sep 17 00:00:00 2001 From: handsomezhuzhu <2658601135@qq.com> Date: Sat, 20 Dec 2025 22:02:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Clock.tsx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/components/Clock.tsx b/src/components/Clock.tsx index 70227f4..49309cd 100644 --- a/src/components/Clock.tsx +++ b/src/components/Clock.tsx @@ -34,9 +34,24 @@ const Clock: React.FC = ({ showSeconds = true, use24HourFormat = tru const minutesStr = rawMinutes.toString().padStart(2, '0'); const secondsStr = rawSeconds.toString().padStart(2, '0'); + const weekday = time.toLocaleDateString('en-US', { weekday: 'short' }).toUpperCase(); + const month = (time.getMonth() + 1).toString().padStart(2, '0'); + const day = time.getDate().toString().padStart(2, '0'); + const datePart = `${month}/${day}`; + return (
+ {/* Short Date (Left side, stacked) */} +
+ + {weekday} + + + {datePart} + +
+ {/* Hours */} {hoursStr} @@ -67,9 +82,9 @@ const Clock: React.FC = ({ showSeconds = true, use24HourFormat = tru )}
- {/* Date Display */} + {/* Motto */}
- {time.toLocaleDateString(language === 'zh' ? 'zh-CN' : 'en-US', { weekday: 'long', month: 'long', day: 'numeric' })} + 同是天涯沦落人,相逢何必曾相识
);