feat: extract timestamp formatting and text truncation into separate utility functions

This commit is contained in:
Abhimanyu Saharan
2026-02-09 00:02:43 +05:30
parent 5ea9719c13
commit 1340e00b61
9 changed files with 64 additions and 150 deletions

View File

@@ -59,20 +59,9 @@ import {
SelectValue,
} from "@/components/ui/select";
import { DashboardShell } from "@/components/templates/DashboardShell";
import { formatTimestamp } from "@/lib/formatters";
import { cn } from "@/lib/utils";
const formatTimestamp = (value?: string | null) => {
if (!value) return "—";
const date = new Date(`${value}${value.endsWith("Z") ? "" : "Z"}`);
if (Number.isNaN(date.getTime())) return "—";
return date.toLocaleString(undefined, {
month: "short",
day: "numeric",
hour: "2-digit",
minute: "2-digit",
});
};
type AccessScope = "all" | "custom";
type BoardAccessState = Record<string, { read: boolean; write: boolean }>;