feat: initial frontend build for RIT Freshers Hub
This commit is contained in:
22
src/lib/utils.ts
Normal file
22
src/lib/utils.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { type ClassValue, clsx } from 'clsx';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
|
||||
export function formatDate(dateStr: string): string {
|
||||
return new Date(dateStr).toLocaleDateString('en-IN', {
|
||||
day: 'numeric',
|
||||
month: 'long',
|
||||
year: 'numeric',
|
||||
});
|
||||
}
|
||||
|
||||
export function formatTime(timeStr: string): string {
|
||||
return timeStr;
|
||||
}
|
||||
|
||||
export function truncate(str: string, n: number): string {
|
||||
return str.length > n ? str.substring(0, n - 1) + '…' : str;
|
||||
}
|
||||
Reference in New Issue
Block a user