Download apps/web/src/lib/utils.ts from websitesi/proje: direct link, hf CLI and curl.
- Browser
- Download file 577 Bytes
-
https://huggingface.co/spaces/websitesi/proje/resolve/main/apps/web/src/lib/utils.ts
- Command line
-
hf download hf://spaces/websitesi/proje/apps/web/src/lib/utils.ts
-
curl -L -o utils.ts https://huggingface.co/spaces/websitesi/proje/resolve/main/apps/web/src/lib/utils.ts
577 Bytes
| 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); | |
| } | |