{"_id":"@c0pt3r/local-date","_rev":"7-3f5932426f3178e5bd4f1c818d14e5fd","name":"@c0pt3r/local-date","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"@c0pt3r/local-date","version":"0.1.0","keywords":["date","localdate","typescript","calendar"],"author":{"name":"C0PT3R"},"license":"MIT","_id":"@c0pt3r/local-date@0.1.0","maintainers":[{"name":"c0pt3r","email":"contact@elie-gendron.com"}],"homepage":"https://github.com/C0PT3R/LocalDate#readme","bugs":{"url":"https://github.com/C0PT3R/LocalDate/issues"},"dist":{"shasum":"fce3d44cce2d2594b4c27ebedddc0a29177267b8","tarball":"https://registry.npmjs.org/@c0pt3r/local-date/-/local-date-0.1.0.tgz","fileCount":6,"integrity":"sha512-y/Jjia2jHF6GECEntIRy03X3+l2pxlH7HnH9fOW/CXdkmZeaTO16cgvl40Qd5mXj7Vf+qRt4ovFhgInjBlZ2ew==","signatures":[{"sig":"MEYCIQCZ6pDgTw0vGnBjwOYMzBStJja+IhtWpsXTQYxyQi76kgIhALSr/qmwdSkVc94HpTRJd/Fq1SznzzLbb/INMd925sH6","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15779},"type":"module","types":"./dist/index.d.ts","exports":{".":"./dist/index.js"},"gitHead":"8b12cd1b4a67adbe3cb8880acb39c1b145f44af2","scripts":{"test":"vitest","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"c0pt3r","email":"contact@elie-gendron.com"},"repository":{"url":"git+https://github.com/C0PT3R/LocalDate.git","type":"git"},"_npmVersion":"11.8.0","description":"A lightweight immutable local date class for TypeScript.","directories":{},"_nodeVersion":"24.13.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/local-date_0.1.0_1785029947171_0.19095803643312137","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@c0pt3r/local-date","version":"0.1.1","keywords":["date","localdate","typescript","calendar"],"author":{"name":"C0PT3R"},"license":"MIT","_id":"@c0pt3r/local-date@0.1.1","maintainers":[{"name":"c0pt3r","email":"contact@elie-gendron.com"}],"homepage":"https://github.com/C0PT3R/LocalDate#readme","bugs":{"url":"https://github.com/C0PT3R/LocalDate/issues"},"dist":{"shasum":"fd698855e76e60b653f9fcc6ff9c6e48916033bf","tarball":"https://registry.npmjs.org/@c0pt3r/local-date/-/local-date-0.1.1.tgz","fileCount":10,"integrity":"sha512-VIF301UxaGOsa6D3DFa+4ILfNJlCQ/uN6TAHcxUt+f0w8t+oiKPSaAI24S6EOK3yDsnM0BtOboTGP47HrgM3tg==","signatures":[{"sig":"MEUCIE8WKfsZA6Vsn3diXawxh+rHf/kns6OdzIJ44ifjPmGSAiEAiPIBQMbXxAZovGS6xAbk5JfmP6s2LLqZQjds7I1YN5Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16191},"type":"module","types":"./dist/index.d.ts","exports":{".":"./dist/index.js"},"gitHead":"ce0f8b1083d0ad653f39887167595a63a4f531be","scripts":{"test":"vitest","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"c0pt3r","email":"contact@elie-gendron.com"},"repository":{"url":"git+https://github.com/C0PT3R/LocalDate.git","type":"git"},"_npmVersion":"11.8.0","description":"A lightweight immutable local date class for TypeScript.","directories":{},"_nodeVersion":"24.13.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/local-date_0.1.1_1785030838692_0.3720711624672408","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@c0pt3r/local-date","version":"0.1.2","keywords":["date","localdate","typescript","calendar"],"author":{"name":"C0PT3R"},"license":"MIT","_id":"@c0pt3r/local-date@0.1.2","maintainers":[{"name":"c0pt3r","email":"contact@elie-gendron.com"}],"homepage":"https://github.com/C0PT3R/LocalDate#readme","bugs":{"url":"https://github.com/C0PT3R/LocalDate/issues"},"dist":{"shasum":"6444ed3c3508cb8aa79ab0b6cc38263e254981ef","tarball":"https://registry.npmjs.org/@c0pt3r/local-date/-/local-date-0.1.2.tgz","fileCount":10,"integrity":"sha512-DROG/5xScW8PwmcyQPT+/HEaeZLPbaYYtS0N38yNYJnGKblFIPiOIY6Lv9g02AzCpAkvUjkt7kXe3tzCvz4LmQ==","signatures":[{"sig":"MEUCIQD+eCe/GAa3UkVcl15DuQQqUDDNBKmZcpjGFby/h4CEkgIgcuP8lil/4XuX5zab4hAqzcAy+FFHi01kCnSgVdYOta0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19474},"type":"module","types":"./dist/index.d.ts","exports":{".":"./dist/index.js"},"gitHead":"23f84dccdcd8233070b67a00ebe975f2aaedbc15","scripts":{"test":"vitest","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"c0pt3r","email":"contact@elie-gendron.com"},"repository":{"url":"git+https://github.com/C0PT3R/LocalDate.git","type":"git"},"_npmVersion":"11.8.0","description":"A lightweight immutable local date class for TypeScript.","directories":{},"_nodeVersion":"24.13.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/local-date_0.1.2_1785033343882_0.13565870681085967","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@c0pt3r/local-date","version":"0.1.3","keywords":["date","localdate","typescript","calendar"],"author":{"name":"C0PT3R"},"license":"MIT","_id":"@c0pt3r/local-date@0.1.3","maintainers":[{"name":"c0pt3r","email":"contact@elie-gendron.com"}],"homepage":"https://github.com/C0PT3R/LocalDate#readme","bugs":{"url":"https://github.com/C0PT3R/LocalDate/issues"},"dist":{"shasum":"29f3c36b2df8e070bfd9e807b914ba50b7dec435","tarball":"https://registry.npmjs.org/@c0pt3r/local-date/-/local-date-0.1.3.tgz","fileCount":10,"integrity":"sha512-bnw1mE9qqnELZDS2w3rJVGw0+ZW1HnE5epvRG5QrzCzHF8h/QeX90w0Xxt/aOudtTXhCq3DgQ8GjNG/cPKpMWw==","signatures":[{"sig":"MEUCIBlTgsIqRN+zZpgN9eFGNt5ECt+NEJlPZ/EJhyIWrZAyAiEAgZyIMDqTSEP7JFM7IFGHJobN0eyFJIxIuU50JEXmeSw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31855},"type":"module","types":"./dist/index.d.ts","exports":{".":"./dist/index.js"},"gitHead":"688d59465af729f0016cab3c195265345764aa4c","scripts":{"test":"vitest","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"c0pt3r","email":"contact@elie-gendron.com"},"repository":{"url":"git+https://github.com/C0PT3R/LocalDate.git","type":"git"},"_npmVersion":"11.8.0","description":"A lightweight TypeScript library for calendar dates without time or timezone.","directories":{},"_nodeVersion":"24.13.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/local-date_0.1.3_1785037474997_0.41426692848431057","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@c0pt3r/local-date","version":"0.1.4","keywords":["date","localdate","typescript","calendar"],"author":{"name":"C0PT3R"},"license":"MIT","_id":"@c0pt3r/local-date@0.1.4","maintainers":[{"name":"c0pt3r","email":"contact@elie-gendron.com"}],"homepage":"https://github.com/C0PT3R/LocalDate#readme","bugs":{"url":"https://github.com/C0PT3R/LocalDate/issues"},"dist":{"shasum":"345dc4be9af131dbe02ec8d9505cac5dfaf7a304","tarball":"https://registry.npmjs.org/@c0pt3r/local-date/-/local-date-0.1.4.tgz","fileCount":10,"integrity":"sha512-8IqvNAv+ad/jjnDuTDdgUD+OsNOSqnYyc4gkS10kW79s8XkFyNlMDFGbq9vVX0sEMSejq5e2/CIePuKHGmKKaA==","signatures":[{"sig":"MEUCIFZPEHllt96a4rBG/yotOLe9XT36mM0yolkfosK/cD+bAiEAwMNq646ms41dqfEAE4EHiJtYsXxL+MGdX1U4Ou5be8U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31864},"type":"module","types":"./dist/index.d.ts","exports":{".":"./dist/index.js"},"gitHead":"35ae0eb9c5a2adb019c1d87b267d22411d51a673","scripts":{"test":"vitest","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"c0pt3r","email":"contact@elie-gendron.com"},"repository":{"url":"git+https://github.com/C0PT3R/LocalDate.git","type":"git"},"_npmVersion":"11.8.0","description":"A lightweight TypeScript library for calendar dates without time or timezone.","directories":{},"_nodeVersion":"24.13.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/local-date_0.1.4_1785037875112_0.5044649141108433","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@c0pt3r/local-date","version":"0.1.5","keywords":["date","localdate","typescript","calendar"],"author":{"name":"C0PT3R"},"license":"MIT","_id":"@c0pt3r/local-date@0.1.5","maintainers":[{"name":"c0pt3r","email":"contact@elie-gendron.com"}],"homepage":"https://github.com/C0PT3R/LocalDate#readme","bugs":{"url":"https://github.com/C0PT3R/LocalDate/issues"},"dist":{"shasum":"cf61d4413ea2818007558871486ad1d92d810dc5","tarball":"https://registry.npmjs.org/@c0pt3r/local-date/-/local-date-0.1.5.tgz","fileCount":10,"integrity":"sha512-ZA/KqxPNKKWZ2zHd0MrS1qYvIplZD8vYKrodbQKI1mR1KrdnmiQEY7JqVFuZHld5JgrSea+6FdOdVyFqxRGokQ==","signatures":[{"sig":"MEQCIBmf8rmmMra/jHaZRT1ZKIAm6qK/zpltlZA8Ald0GZ1mAiBzBWAVk+0ffGsI1kXvI/w7eH2QHbud8cDGrYsbFaljsA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33943},"type":"module","types":"./dist/index.d.ts","exports":{".":"./dist/index.js"},"gitHead":"d8c841ce9ec161ff1b99eb5793557506d63e2353","scripts":{"test":"vitest","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"c0pt3r","email":"contact@elie-gendron.com"},"repository":{"url":"git+https://github.com/C0PT3R/LocalDate.git","type":"git"},"_npmVersion":"11.8.0","description":"A lightweight TypeScript library for calendar dates without time or timezone.","directories":{},"_nodeVersion":"24.13.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/local-date_0.1.5_1785503480369_0.24311765702182964","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@c0pt3r/local-date","version":"1.0.0","description":"An immutable, timezone-free Gregorian calendar date for TypeScript and JavaScript.","author":{"name":"C0PT3R"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/C0PT3R/LocalDate.git"},"bugs":{"url":"https://github.com/C0PT3R/LocalDate/issues"},"homepage":"https://github.com/C0PT3R/LocalDate#readme","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"clean":"node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"","build":"npm run clean && tsc -p tsconfig.json","test":"npm run build && node --test test/*.test.mjs","check":"npm run test && npm pack --dry-run","prepublishOnly":"npm run check"},"devDependencies":{"typescript":"^5.8.3"},"keywords":["date","localdate","typescript","calendar","immutable","gregorian"],"publishConfig":{"access":"public","provenance":true},"gitHead":"c8832bb824ab57b444b640f128fdae19c30309ed","_id":"@c0pt3r/local-date@1.0.0","_nodeVersion":"24.13.1","_npmVersion":"11.8.0","dist":{"integrity":"sha512-nrWOg3JXaQkKwKirYZzL7nUL8diojcRdsgeZZ1EDAYUKZpYsPD0vmeQhyH7SzUH7Qtp/XPQ1MHWP2QIMptYd8g==","shasum":"ac962fb626301a57d7c4cbd9d29e4e6e96f42074","tarball":"https://registry.npmjs.org/@c0pt3r/local-date/-/local-date-1.0.0.tgz","fileCount":8,"unpackedSize":35843,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDCai4aV0TXMfx+NrLc74V6EX4IYXYDW+ldPExSmYoZegIge1WkcWC8gDai4aj9bqfWtCpqV1nFlytigjW4ISggsSo="}]},"_npmUser":{"name":"c0pt3r","email":"contact@elie-gendron.com"},"directories":{},"maintainers":[{"name":"c0pt3r","email":"contact@elie-gendron.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/local-date_1.0.0_1785711058110_0.8179327345137406"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-26T01:39:07.018Z","modified":"2026-08-02T22:50:58.396Z","0.1.0":"2026-07-26T01:39:07.316Z","0.1.1":"2026-07-26T01:53:58.884Z","0.1.2":"2026-07-26T02:35:44.019Z","0.1.3":"2026-07-26T03:44:35.138Z","0.1.4":"2026-07-26T03:51:15.251Z","0.1.5":"2026-07-31T13:11:20.515Z","1.0.0":"2026-08-02T22:50:58.239Z"},"bugs":{"url":"https://github.com/C0PT3R/LocalDate/issues"},"author":{"name":"C0PT3R"},"license":"MIT","homepage":"https://github.com/C0PT3R/LocalDate#readme","keywords":["date","localdate","typescript","calendar","immutable","gregorian"],"repository":{"type":"git","url":"git+https://github.com/C0PT3R/LocalDate.git"},"description":"An immutable, timezone-free Gregorian calendar date for TypeScript and JavaScript.","maintainers":[{"name":"c0pt3r","email":"contact@elie-gendron.com"}],"readme":"# LocalDate\n\nAn immutable Gregorian calendar date for TypeScript and JavaScript.\n\n`LocalDate` represents only a year, month, and day. It has no time, timezone, UTC offset, or daylight-saving behavior. Its core arithmetic does not use JavaScript `Date`, so calendar operations are deterministic in every runtime.\n\n## Installation\n\n```bash\nnpm install @c0pt3r/local-date\n```\n\n## Create dates\n\n```ts\nimport { LocalDate } from \"@c0pt3r/local-date\"\n\nconst date = new LocalDate(2026, 8, 2)\nconst parsed = LocalDate.fromISO(\"2026-08-02\")\nconst today = LocalDate.today()\nconst todayUTC = LocalDate.todayUTC()\n```\n\nThe supported range is `0000-01-01` through `9999-12-31` in the proleptic Gregorian calendar.\n\n## Read fields\n\n```ts\n date.year         // 2026\n date.month        // 8\n date.day          // 2\n date.dayOfWeek    // 7; Monday = 1, Sunday = 7\n date.dayOfYear    // 214\n date.daysInMonth  // 31\n date.daysInYear   // 365\n date.isLeapYear   // false\n```\n\n## Immutable updates\n\nEvery operation returns a new `LocalDate`. Existing values never change.\n\n```ts\nconst invoiceDate = new LocalDate(2024, 1, 31)\nconst nextMonth = invoiceDate.plusMonths(1)\n\ninvoiceDate.toISO() // \"2024-01-31\"\nnextMonth.toISO()   // \"2024-02-29\"\n```\n\nCalendar arithmetic constrains the day by default when a target month is shorter:\n\n```ts\nnew LocalDate(2024, 2, 29).plusYears(1).toISO() // \"2025-02-28\"\n```\n\nUse strict overflow handling when silent clamping is undesirable:\n\n```ts\nnew LocalDate(2024, 1, 31).plusMonths(1, { overflow: \"reject\" })\n// throws LocalDateError\n```\n\nAvailable operations:\n\n```ts\ndate.with({ year: 2027, month: 3 })\ndate.plus({ years: 1, months: 2, weeks: 3, days: 4 })\ndate.minus({ months: 6 })\ndate.plusDays(10)\ndate.plusWeeks(2)\ndate.plusMonths(1)\ndate.plusYears(1)\n```\n\n## Epoch days\n\nEpoch days use the conventional Unix date epoch:\n\n```ts\nnew LocalDate(1970, 1, 1).epochDay // 0\nLocalDate.fromEpochDay(-1).toISO() // \"1969-12-31\"\n```\n\n## Comparison and differences\n\n```ts\nconst start = new LocalDate(2026, 1, 1)\nconst end = new LocalDate(2026, 2, 1)\n\nLocalDate.compare(start, end) // -1\nstart.equals(end)             // false\nstart.isBefore(end)           // true\nend.isAfter(start)            // true\nstart.daysUntil(end)          // 31\n\nnew LocalDate(2026, 1, 15).isBetween(start, end) // true\n```\n\n`isBetween()` requires ordered bounds and includes them by default.\n\n## Conversion and serialization\n\n```ts\ndate.toISO()          // \"2026-08-02\"\ndate.toString()       // \"2026-08-02\"\ndate.toJSON()         // \"2026-08-02\"\ndate.toDateUTC()      // JavaScript Date at midnight UTC\ndate.toLocaleString(\"en-CA\", { dateStyle: \"long\" })\n```\n\n`JSON.stringify()` automatically emits the ISO date string.\n\n## Error behavior\n\nInvalid calendar values and out-of-range arithmetic throw `LocalDateError`, which extends `RangeError`. Incorrect argument types throw `TypeError`.\n\n```ts\nimport { LocalDate, LocalDateError } from \"@c0pt3r/local-date\"\n```\n\n## Design guarantees\n\n- Immutable values\n- No runtime dependencies\n- No timezone in the core model\n- Standard Unix epoch-day semantics\n- Strict `YYYY-MM-DD` parsing\n- ISO weekday numbering\n- Safe-integer validation\n- Deterministic Gregorian arithmetic\n- ESM package with TypeScript declarations\n- Node.js 18 or newer\n\n## License\n\nMIT\n","readmeFilename":"README.md"}