20 lines
470 B
TypeScript
20 lines
470 B
TypeScript
import { clsx, type ClassValue } from "clsx";
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
return clsx(inputs);
|
|
}
|
|
|
|
export function formatRupiah(amount: number): string {
|
|
return new Intl.NumberFormat("id-ID", {
|
|
style: "currency",
|
|
currency: "IDR",
|
|
minimumFractionDigits: 0,
|
|
}).format(amount);
|
|
}
|
|
|
|
export function formatDate(date: Date | string): string {
|
|
return new Intl.DateTimeFormat("id-ID", {
|
|
dateStyle: "long",
|
|
}).format(new Date(date));
|
|
}
|