Skip to content

Commit be74fb6

Browse files
committed
updated timestamps to match client
1 parent c1368e0 commit be74fb6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const INITIAL_MESSAGE: Message = {
1313
Upload an image and ask how you want your images edited.\
1414
You may select multiple images for me to refer to.",
1515
sender: "agent",
16-
timestamp: new Date("2024-01-01T00:00:00Z"), // Static timestamp for hydration
16+
timestamp: new Date(), // Use current time instead of static timestamp
1717
};
1818

1919
const SAMPLE_IMAGES: ImageItem[] = [

src/ui/chat-interface.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ export default function ChatInterface({
9696

9797
const formatTime = (date: Date) => {
9898
if (!isClient) return ""; // Don't render time on server to avoid hydration mismatch
99-
return date.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
99+
return date.toLocaleTimeString(navigator.language, {
100+
hour: "2-digit",
101+
minute: "2-digit",
102+
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
103+
});
100104
};
101105

102106
const TypingIndicator = () => (

0 commit comments

Comments
 (0)