{"_id":"@danielgtmn/date-range-helper","_rev":"2-6305166da693e44749dae5289d5d6508","name":"@danielgtmn/date-range-helper","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.2":{"name":"@danielgtmn/date-range-helper","version":"0.0.2","keywords":["date","date-range","utility","typescript","helper"],"author":{"name":"Daniel Gietmann"},"license":"MIT","_id":"@danielgtmn/date-range-helper@0.0.2","maintainers":[{"name":"danielgietmann","email":"danielgietmann@gietmanic.com"}],"homepage":"https://github.com/danielgtmn/date-range-helper#readme","bugs":{"url":"https://github.com/danielgtmn/date-range-helper/issues"},"dist":{"shasum":"219993791556f92d5dd942bb54171d72613a175e","tarball":"https://registry.npmjs.org/@danielgtmn/date-range-helper/-/date-range-helper-0.0.2.tgz","fileCount":6,"integrity":"sha512-ecsndWaGXw/p4tU3nxPoD+QjRJXjRADwU6oKzTh+JZNlijwPFcJh1IyePwVbtDjCfD9YKXwnQIOfSinLwvHFIg==","signatures":[{"sig":"MEUCIFY1tJRq47t93/Qhxt2jJHiw529HmXuLO1a24ETVTL96AiEAlpHKaXY7Gr0j3GCP2j4IL5bZGTQA414l8rrvPGWImN0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6006},"main":"dist/index.cjs","_from":"file:danielgtmn-date-range-helper-0.0.2.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs"}},"scripts":{"test":"vitest","build":"tsup","test:watch":"vitest --watch"},"_npmUser":{"name":"danielgietmann","email":"danielgietmann@gietmanic.com"},"_resolved":"/tmp/724746b0accf97342d17fc17a957e5b9/danielgtmn-date-range-helper-0.0.2.tgz","_integrity":"sha512-ecsndWaGXw/p4tU3nxPoD+QjRJXjRADwU6oKzTh+JZNlijwPFcJh1IyePwVbtDjCfD9YKXwnQIOfSinLwvHFIg==","repository":{"url":"git+https://github.com/danielgtmn/date-range-helper.git","type":"git"},"_npmVersion":"10.8.2","description":"A lightweight utility for working with date ranges in JavaScript/TypeScript.","directories":{},"_nodeVersion":"20.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","vitest":"^1.6.1","typescript":"^5.8.2","@types/jest":"^29.5.14"},"_npmOperationalInternal":{"tmp":"tmp/date-range-helper_0.0.2_1743043293277_0.09270520847259855","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@danielgtmn/date-range-helper","version":"0.0.3","description":"A lightweight utility for working with date ranges in JavaScript/TypeScript.","main":"dist/index.cjs","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"require":"./dist/index.cjs","import":"./dist/index.mjs"}},"keywords":["date","date-range","utility","typescript","helper"],"repository":{"type":"git","url":"git+https://github.com/danielgtmn/date-range-helper.git"},"bugs":{"url":"https://github.com/danielgtmn/date-range-helper/issues"},"homepage":"https://github.com/danielgtmn/date-range-helper#readme","author":{"name":"Daniel Gietmann"},"license":"MIT","devDependencies":{"@types/jest":"^29.5.14","tsup":"^8.4.0","typescript":"^5.8.2","vitest":"^1.6.1"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","test":"vitest","test:watch":"vitest --watch"},"_id":"@danielgtmn/date-range-helper@0.0.3","_integrity":"sha512-cCXW+YNoEnxECCgP+8mf7ox/HC+wuwN3doCU18MBx52AGyXdvY9rE5LBgYWeV1jtRxsYo+RoTYHPsimD+JPOLg==","_resolved":"/tmp/bd40801ce9f2b5b8c9e3e2615d737a62/danielgtmn-date-range-helper-0.0.3.tgz","_from":"file:danielgtmn-date-range-helper-0.0.3.tgz","_nodeVersion":"20.19.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-cCXW+YNoEnxECCgP+8mf7ox/HC+wuwN3doCU18MBx52AGyXdvY9rE5LBgYWeV1jtRxsYo+RoTYHPsimD+JPOLg==","shasum":"9ae8df375b1e15d78bca7f6723e6854077465ae4","tarball":"https://registry.npmjs.org/@danielgtmn/date-range-helper/-/date-range-helper-0.0.3.tgz","fileCount":6,"unpackedSize":11976,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAQR03bGQm9wJFA9NrLXAVhk0g6DHI8/OO5AsJZkP16XAiBNc/JLVibPzVaoBHfrHKY+0/vcEeIC+lzMAgV3hBgmzQ=="}]},"_npmUser":{"name":"danielgietmann","email":"danielgietmann@gietmanic.com"},"directories":{},"maintainers":[{"name":"danielgietmann","email":"danielgietmann@gietmanic.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/date-range-helper_0.0.3_1743630574090_0.5932167494609724"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-27T02:41:33.199Z","modified":"2025-04-02T21:49:34.464Z","0.0.2":"2025-03-27T02:41:33.515Z","0.0.3":"2025-04-02T21:49:34.271Z"},"bugs":{"url":"https://github.com/danielgtmn/date-range-helper/issues"},"author":{"name":"Daniel Gietmann"},"license":"MIT","homepage":"https://github.com/danielgtmn/date-range-helper#readme","keywords":["date","date-range","utility","typescript","helper"],"repository":{"type":"git","url":"git+https://github.com/danielgtmn/date-range-helper.git"},"description":"A lightweight utility for working with date ranges in JavaScript/TypeScript.","maintainers":[{"name":"danielgietmann","email":"danielgietmann@gietmanic.com"}],"readme":"# @danielgtmn/date-range-helper\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg)](https://www.typescriptlang.org/)\n[![npm version](https://img.shields.io/npm/v/@danielgtmn/date-range-helper)](https://www.npmjs.com/package/@danielgtmn/date-range-helper)\n\nA lightweight, zero-dependency library for working with date ranges in JavaScript and TypeScript.\n\n## 📦 Installation\n\n```bash\nnpm install @danielgtmn/date-range-helper\n# or\npnpm install @danielgtmn/date-range-helper\n# or\nyarn add @danielgtmn/date-range-helper\n```\n\n## 🧠 Funktionen\n\n### getCurrentMonthRange()\n\nReturns the start and end time of the current month.\n\n```bash\nconst { start, end } = getCurrentMonthRange();\n```\n\n### getPreviousMonthRange()\nReturns the start and end time of the previous month.\n```bash\nconst { start, end } = getPreviousMonthRange();\n```\n\n### getNextMonthRange()\nReturns the start and end time of the next month.\n```bash\nconst { start, end } = getNextMonthRange();\n```\n\n### getCurrentWeekRange()\n\nReturns the start and end time of the current week (Monday to Sunday).\n\n```bash\nconst { start, end } = getCurrentWeekRange();\n```\n\n### getPreviousWeekRange()\nReturns the start and end time of the previous week (Monday to Sunday).\n```bash\nconst { start, end } = getPreviousWeekRange();\n```\n\n### getNextWeekRange()\nReturns the start and end time of the next week (Monday to Sunday).\n```bash\nconst { start, end } = getNextWeekRange();\n```\n\n## Utility Functions\n\n### isInRange(date, { start, end })\n\nChecks whether a date is within a range.\n\n```bash\nconst isTodayInRange = isInRange(new Date(), { start, end });\n```\n\n### getDaysBetween(start, end)\n\nCalculates the number of full days between two dates.\n\n```bash\nconst days = getDaysBetween(new Date('2025-03-01'), new Date('2025-03-10'));\n```\n\n### getDateList(start, end)\n\nGenerates a list of all data between two points in time.\n\n```bash\nconst dates = getDateList(new Date('2025-03-01'), new Date('2025-03-03'));\n// [2025-03-01, 2025-03-02, 2025-03-03]\n```\n\n### normalizeDate(date)\nConverts a date to a string in the format 'YYYY-MM-DD'.\n```bash\nconst normalizedDate = normalizeDate(new Date('2025-03-01'));\n// '2025-03-01'\n```\n\n## Timezone Support \nThis library is timezone-aware. All date operations are performed in the local timezone of the device.\n## toTimezone(date, timezone)\nConverts a date to a specific timezone.\n```bash\nconst dateInNewYork = toTimezone(new Date(), 'America/New_York');\n```\n\n## getCurrentMonthRangeInTimezone(timezone)\nReturns the start and end time of the current month in a specific timezone.\n```bash\nconst { start, end } = getCurrentMonthRangeInTimezone('America/New_York');\n```\n\n## getCurrentWeekRangeInTimezone(timezone)\nReturns the start and end time of the current week in a specific timezone.\n```bash\nconst { start, end } = getCurrentWeekRangeInTimezone('America/New_York');\n```\n\n\n\n## 🤝 Contributing\nContributions are welcome! Please read the [contributing guidelines](CONTRIBUTING.md) first.\n\n## 🧪 Beispiel\n\n```bash\nimport {\n  getCurrentWeekRange,\n  isInRange,\n  getDateList\n} from '@danielgtmn/date-range-helper';\n\nconst { start, end } = getCurrentWeekRange();\nconsole.log(getDateList(start, end)); // Alle Tage dieser Woche\n```\n\n## 📝 License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n\n## 🤝 Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📫 Support\n\n- Create a [GitHub issue](https://github.com/danielgtmn/date-range-helper/issues) for bug reports and feature requests\n- Follow [@danielgtmn](https://github.com/danielgtmn) for announcements\n\n\n","readmeFilename":"README.md"}