{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "logic",
  "type": "registry:lib",
  "title": "Date helpers",
  "description": "Date formatting and range helpers shared by the date pickers.",
  "dependencies": [
    "date-fns@^4.1.0"
  ],
  "files": [
    {
      "path": "src/consts.ts",
      "type": "registry:lib",
      "target": "lib/wideset/consts.ts",
      "content": "export const DATE_ISO_FORMAT = 'yyyy-MM-dd';\nexport const DATE_FORMAT = 'MM.dd.yyyy';\n"
    },
    {
      "path": "src/logic/date.ts",
      "type": "registry:lib",
      "target": "lib/wideset/date.ts",
      "content": "import { format, formatISO, parse } from 'date-fns';\nimport { DATE_FORMAT, DATE_ISO_FORMAT } from '@/lib/wideset/consts';\n\nexport const formatDateToISOString = (day: Date | undefined) =>\n  day && formatISO(day, { representation: 'date' });\n\nexport const formatISODateToAnotherFormat = (\n  day: string | undefined,\n  dateFormat: string = DATE_FORMAT,\n) => (day ? format(parseISODate(day)!, dateFormat) : undefined);\n\nexport const parseISODate = (day: string | undefined) =>\n  day ? parse(day, DATE_ISO_FORMAT, new Date()) : undefined;\n"
    },
    {
      "path": "src/logic/helpers.ts",
      "type": "registry:lib",
      "target": "lib/wideset/helpers.ts",
      "content": "export const generateId = () =>\n  `inline-alert-${\n    globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`\n  }`;\n\nexport const isBrowser = () => typeof window !== 'undefined';\n"
    },
    {
      "path": "src/types/date.types.ts",
      "type": "registry:lib",
      "target": "lib/wideset/date.types.ts",
      "content": "export type DateStringRange =\n  | {\n      from: string | undefined;\n      to?: string | undefined;\n    }\n  | undefined;\n"
    }
  ],
  "meta": {
    "version": "1.0.0",
    "commit": "8bb3627"
  }
}
