Spaces:
Runtime error
Runtime error
| import { type ClassValue, clsx } from 'clsx' | |
| import { twMerge } from 'tailwind-merge' | |
| export function cn(...inputs: ClassValue[]) { | |
| return twMerge(clsx(inputs)) | |
| } | |
| export const cropColors: Record<string, string> = { | |
| almonds: '#3B82F6', | |
| grapes: '#8B5CF6', | |
| olives: '#EF4444', | |
| pistachios: '#22C55E', | |
| table_grapes: '#F59E0B', | |
| } | |
| export function formatDate(date: Date | string): string { | |
| const d = typeof date === 'string' ? new Date(date) : date | |
| return d.toLocaleDateString('en-US', { | |
| year: 'numeric', | |
| month: 'short', | |
| day: 'numeric', | |
| }) | |
| } | |
| export function formatDateTime(date: Date | string): string { | |
| const d = typeof date === 'string' ? new Date(date) : date | |
| return d.toLocaleString('en-US', { | |
| year: 'numeric', | |
| month: 'short', | |
| day: 'numeric', | |
| hour: '2-digit', | |
| minute: '2-digit', | |
| }) | |
| } | |