Spaces:
Sleeping
Sleeping
| import { type ClassValue, clsx } from 'clsx'; | |
| import { format } from 'date-fns'; | |
| import { tr } from 'date-fns/locale'; | |
| import { twMerge } from 'tailwind-merge'; | |
| export function cn(...inputs: ClassValue[]) { | |
| return twMerge(clsx(inputs)); | |
| } | |
| export function formatDate(date: Date | string, pattern = 'dd.MM.yyyy') { | |
| return format(new Date(date), pattern, { locale: tr }); | |
| } | |
| export function formatCurrency(amount: number, currency = 'TRY') { | |
| return new Intl.NumberFormat('tr-TR', { | |
| style: 'currency', | |
| currency, | |
| maximumFractionDigits: 0, | |
| }).format(amount); | |
| } | |