{"version":3,"sources":["../../src/date/dayjs.ts"],"names":[],"mappings":";;;AAwBO,SAAS,qBAAA,CAAsB,KAAA,EAAiC,QAAA,GAAW,KAAA,EAA2B;AAC3G,EAAA,IAAI,CAAC,KAAA,IAAS,CAAC,KAAA,CAAM,OAAA,IAAW,OAAO,MAAA;AACvC,EAAA,OAAO,QAAA,GAAW,KAAA,CAAM,KAAA,CAAM,KAAK,CAAA,CAAE,WAAA,EAAY,GAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,CAAE,WAAA,EAAY;AACxF","file":"dayjs.cjs","sourcesContent":["import type { Dayjs } from \"dayjs\";\n\n/**\n * Converts a Dayjs picker value to a UTC ISO timestamp anchored at the user's\n * LOCAL day boundary.\n *\n * Used by date-range filter bars where the BE expects a full ISO timestamp\n * boundary — `OccurredFrom` is start-of-local-day, `OccurredTo` is\n * end-of-local-day so the filter is inclusive of the user's calendar day\n * regardless of their timezone.\n *\n * Critical: hardcoding `T00:00:00.000Z` on the formatted date treats the picker\n * value as UTC, which shifts the boundary by the user's offset (e.g. a user in\n * Europe/London during BST loses the first hour of their local day).\n * `startOf(\"day\")` / `endOf(\"day\")` give the local boundary; `.toISOString()`\n * then converts to UTC for the wire.\n *\n * Lives behind the `@ethisyscore/core-utils/date/dayjs` sub-path so the core\n * entry stays free of the optional `dayjs` peer dependency.\n *\n * @param value - The Dayjs picker value (or null when the user cleared the field)\n * @param endOfDay - When true, returns the end-of-local-day boundary\n * @returns ISO timestamp string in UTC, or undefined when the value is null/invalid\n */\nexport function dayjsToIsoDayBoundary(value: Dayjs | null | undefined, endOfDay = false): string | undefined {\n  if (!value || !value.isValid()) return undefined;\n  return endOfDay ? value.endOf(\"day\").toISOString() : value.startOf(\"day\").toISOString();\n}\n"]}