mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 01:48:12 +00:00
user management ui
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
import { formatDistanceToNow, parseISO } from "date-fns";
|
||||
|
||||
export const getRelativeTime = (isoDate: string): string => {
|
||||
return formatDistanceToNow(parseISO(isoDate), { addSuffix: true });
|
||||
};
|
||||
28
apps/edr-freight-web/backoffice/src/super-admin/lib/utils.ts
Normal file
28
apps/edr-freight-web/backoffice/src/super-admin/lib/utils.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { ClassValue, clsx } from "clsx";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
|
||||
export function formatDate(input: string | number | Date): string {
|
||||
const date = new Date(input);
|
||||
return date.toLocaleDateString("en-US", {
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
year: "numeric",
|
||||
});
|
||||
}
|
||||
|
||||
export function formatDateTime(input: string | number | Date): string {
|
||||
const date = new Date(input);
|
||||
return date.toLocaleDateString("en-US", {
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
year: "numeric",
|
||||
hour: "numeric",
|
||||
minute: "numeric",
|
||||
});
|
||||
}
|
||||
|
||||
// Add any other utility functions here that might be needed
|
||||
Reference in New Issue
Block a user