/** * This file contains application-specific overrides and configuration * for the generic Admin Panel. */ export interface FieldOverride { displayField?: string; formatter?: (value: any) => string; } export interface ResourceOverride { fields?: Record; } export const configuration: Record = { expenses: { fields: { payee: { displayField: "name", }, payor: { displayField: "username", }, account: { displayField: "nickname", }, tags: { displayField: "name", }, occurred_at: { formatter: (val: string) => { const date = new Date(val); const day = date.getDate(); const month = date.toLocaleString('default', { month: 'long' }); const year = date.getFullYear(); const suffix = (day: number) => { if (day > 3 && day < 21) return 'th'; switch (day % 10) { case 1: return "st"; case 2: return "nd"; case 3: return "rd"; default: return "th"; } }; return `${day}${suffix(day)} ${month} ${year}`; } } }, }, };