{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "extends": "none",
  "name": "date",
  "title": "date",
  "description": "date",
  "files": [
    {
      "path": "src/lib/date.ts",
      "content": "export function formatDatetime(input?: string): string {\n  const date = input ? new Date(input) : new Date()\n  const now = new Date()\n\n  return date\n    .toLocaleString('en-GB', {\n      day: '2-digit',\n      month: 'short',\n      year: date.getFullYear() === now.getFullYear() ? undefined : 'numeric',\n      hour: '2-digit',\n      minute: '2-digit',\n      hour12: false,\n    })\n    .replace(',', '')\n}\n\nexport function formatDate(input?: string | Date): string {\n  const date = input ? new Date(input) : new Date()\n  const now = new Date()\n\n  return date.toLocaleDateString('en-GB', {\n    day: '2-digit',\n    month: 'short',\n    year: date.getFullYear() === now.getFullYear() ? undefined : 'numeric',\n  })\n}\n\nexport function formatHumans(date: Date) {\n  const diff = Date.now() - date.getTime()\n  const s = Math.floor(diff / 1000)\n  const m = Math.floor(s / 60)\n  const h = Math.floor(m / 60)\n  const d = Math.floor(h / 24)\n  if (s < 60) return 'just now'\n  if (m < 60) return `${m}m ago`\n  if (h < 24) return `${h}h ago`\n  return `${d}d ago`\n}\n",
      "type": "registry:lib"
    }
  ],
  "type": "registry:lib"
}