mirror of
https://github.com/docmost/docmost.git
synced 2026-07-24 10:32:50 +10:00
feat(ee): bases
Table and kanban UI, formula engine package, and the base-embed editor extension
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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();
|
||||
}
|
||||
Reference in New Issue
Block a user