Files
docmost/apps/client/src/ee/base/formatters/cell-formatters.ts
T
Philipinho 4e5bff6d55 feat(ee): bases
Table and kanban UI, formula engine package, and the base-embed editor extension
2026-06-14 01:29:06 +01:00

23 lines
725 B
TypeScript

import { formatNumber } from "@/ee/base/components/cells/cell-number";
import { formatDateDisplay } from "@/ee/base/components/cells/cell-date";
export { formatNumber, formatDateDisplay };
export function formatTimestamp(value: string | null | undefined): string {
if (typeof value !== "string" || !value) return "";
const date = new Date(value);
if (isNaN(date.getTime())) return "";
return date.toLocaleDateString(undefined, {
month: "short",
day: "numeric",
year: "numeric",
hour: "numeric",
minute: "2-digit",
});
}
export function formatLongTextPreview(value: string | null | undefined): string {
if (typeof value !== "string") return "";
return value.replace(/\s+/g, " ").trim();
}