{"version":3,"sources":["../src/diffDays.ts"],"sourcesContent":["import { diffMilliseconds } from \"./diffMilliseconds\"\nimport type { DateInput, MaybeDateInput } from \"./types\"\nimport { diffRound, type DiffRoundingMethod } from \"./diffRound\"\n\n/**\n * Returns the difference between 2 dates in days.\n * @param dateA - A date to compare with the right date\n * @param [dateB] - A date to compare with the left date or nothing to compare with the current time\n * @param [roundingMethod] - the rounding method to use, default: trunc\n */\nexport function diffDays(\n  dateA: DateInput,\n  dateB?: MaybeDateInput,\n  roundingMethod?: DiffRoundingMethod\n): number\n/**\n * Returns the difference between 2 dates in days.\n * @param [dateA] - A date to compare with the right date or null to compare with the current time\n * @param dateB - A date to compare with the left date\n * @param [roundingMethod] - the rounding method to use, default: trunc\n */\nexport function diffDays(\n  dateA: MaybeDateInput,\n  dateB: DateInput,\n  roundingMethod?: DiffRoundingMethod\n): number\n\nexport function diffDays(\n  dateA: MaybeDateInput,\n  dateB?: MaybeDateInput,\n  roundingMethod?: DiffRoundingMethod\n): number {\n  return diffRound(\n    // @ts-ignore\n    diffMilliseconds(dateA, dateB) / 86_400_000, // hour * 24\n    roundingMethod\n  )\n}\n"],"mappings":";AAAA,SAAS,wBAAwB;AAEjC,SAAS,iBAA0C;AAyB5C,SAAS,SACd,OACA,OACA,gBACQ;AACR,SAAO;AAAA;AAAA,IAEL,iBAAiB,OAAO,KAAK,IAAI;AAAA;AAAA,IACjC;AAAA,EACF;AACF;","names":[]}