From b90129a9813ae5d63ce213e21615339d172bc659 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Tue, 3 Mar 2026 20:15:29 -0500 Subject: [PATCH] Fix hydration mismatch and nativeButton warning in backup section - Use date-fns format() instead of toLocaleDateString() for deterministic server/client date rendering - Set nativeButton={false} on download link Button to suppress base-ui warning Co-Authored-By: Claude Opus 4.6 --- .../settings/_components/backup-section.tsx | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/app/(pages)/settings/_components/backup-section.tsx b/app/(pages)/settings/_components/backup-section.tsx index 6f9be08..43ba684 100644 --- a/app/(pages)/settings/_components/backup-section.tsx +++ b/app/(pages)/settings/_components/backup-section.tsx @@ -8,7 +8,7 @@ import { IconPlus, IconTrash, } from "@tabler/icons-react"; -import { formatDistanceToNow } from "date-fns"; +import { format, formatDistanceToNow } from "date-fns"; import { AnimatePresence, motion } from "motion/react"; import { useRef, useState } from "react"; import { toast } from "sonner"; @@ -42,12 +42,7 @@ function formatBytes(bytes: number): string { } function formatBackupDate(dateStr: string): string { - return new Date(dateStr).toLocaleDateString(undefined, { - month: "short", - day: "numeric", - hour: "numeric", - minute: "2-digit", - }); + return format(new Date(dateStr), "MMM d, h:mm a"); } export function BackupSection({ @@ -159,7 +154,7 @@ export function BackupSection({
- +
Database snapshots @@ -171,7 +166,7 @@ export function BackupSection({
@@ -216,6 +211,7 @@ export function BackupSection({ @@ -337,7 +329,7 @@ export function BackupSection({
- +
Scheduled backups