mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-14 18:10:39 +09:00
16 lines
397 B
TypeScript
16 lines
397 B
TypeScript
|
|
export function cn(...classes: (string | false | null | undefined)[]) {
|
||
|
|
return classes.filter(Boolean).join(" ");
|
||
|
|
}
|
||
|
|
|
||
|
|
export function formatCents(cents: number): string {
|
||
|
|
return `$${(cents / 100).toFixed(2)}`;
|
||
|
|
}
|
||
|
|
|
||
|
|
export function formatDate(date: Date | string): string {
|
||
|
|
return new Date(date).toLocaleDateString("en-US", {
|
||
|
|
month: "short",
|
||
|
|
day: "numeric",
|
||
|
|
year: "numeric",
|
||
|
|
});
|
||
|
|
}
|