{"_id":"@bruceshi/calendar-hook","_rev":"4-a150c997e487f7a77414dfe7113c7079","name":"@bruceshi/calendar-hook","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.1":{"name":"@bruceshi/calendar-hook","private":false,"version":"0.0.1","author":{"name":"shibocuhk@gmail.com"},"type":"module","main":"dist/main.js","types":"dist/main.d.ts","scripts":{"dev":"vite","build":"tsc --p ./tsconfig-build.json && vite build","lint":"eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0","preview":"vite preview","test":"vitest"},"sideEffects":["**/*.css"],"peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"devDependencies":{"@testing-library/react":"^14.1.2","@types/lodash":"^4.14.202","@types/node":"^20.8.10","@types/react":"^18.2.43","@types/react-dom":"^18.2.17","@typescript-eslint/eslint-plugin":"^6.14.0","@typescript-eslint/parser":"^6.14.0","@vitejs/plugin-react":"^4.2.1","autoprefixer":"^10.4.16","daisyui":"^4.4.24","eslint":"^8.55.0","eslint-plugin-react-hooks":"^4.6.0","eslint-plugin-react-refresh":"^0.4.5","glob":"^10.3.10","jsdom":"^23.0.1","postcss":"^8.4.32","react":"^18.2.0","react-dom":"^18.2.0","tailwindcss":"^3.4.0","typescript":"^5.2.2","vite":"^5.0.8","vite-plugin-dts":"^3.6.3","vite-plugin-lib-inject-css":"^1.3.0","vitest":"^1.1.0"},"dependencies":{"date-fns":"^3.0.6","lodash":"^4.17.21"},"gitHead":"47fc4cb0cb47244793f78b69caa7d4eee9cfbc3f","description":"## Overview","_id":"@bruceshi/calendar-hook@0.0.1","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-lz6pKGhAmMQZ2k5OrQtaa5mzhhBcrHfCGHR29C1c5ZhGU7C8xSu5ybL/4DegTa9Fur/NGVrVhv7QA70/yS3wUg==","shasum":"12406073755d824cf0010df1fcc2e2906363de42","tarball":"https://registry.npmjs.org/@bruceshi/calendar-hook/-/calendar-hook-0.0.1.tgz","fileCount":6,"unpackedSize":22898,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCk1Fk7StDxfxYrSfapT7GCgQdrzdqC5Nnm1zR7paPwQwIgGuZPP5czTsQ0dEJ7idpwBS30oVuCDOxg6hvaNKc1kio="}]},"_npmUser":{"name":"bruceshi","email":"shibocuhk@gmail.com"},"directories":{},"maintainers":[{"name":"bruceshi","email":"shibocuhk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/calendar-hook_0.0.1_1703837920331_0.6784076900507348"},"_hasShrinkwrap":false},"0.0.2":{"name":"@bruceshi/calendar-hook","private":false,"version":"0.0.2","author":{"name":"shibocuhk@gmail.com"},"type":"module","main":"dist/calendar-hook.umd.cjs","module":"dist/calendar-hook.js","types":"dist/index.d.ts","exports":{".":{"import":"./dist/calendar-hook.js","require":"./dist/calendar-hook.umd.cjs"}},"scripts":{"dev":"vite","build":"tsc --p ./tsconfig-build.json && vite build","lint":"eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0","preview":"vite preview","test":"vitest"},"sideEffects":["**/*.css"],"peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"devDependencies":{"@testing-library/react":"^14.1.2","@types/lodash":"^4.14.202","@types/node":"^20.8.10","@types/react":"^18.2.43","@types/react-dom":"^18.2.17","@typescript-eslint/eslint-plugin":"^6.14.0","@typescript-eslint/parser":"^6.14.0","@vitejs/plugin-react":"^4.2.1","autoprefixer":"^10.4.16","daisyui":"^4.4.24","eslint":"^8.55.0","eslint-plugin-react-hooks":"^4.6.0","eslint-plugin-react-refresh":"^0.4.5","glob":"^10.3.10","jsdom":"^23.0.1","postcss":"^8.4.32","react":"^18.2.0","react-dom":"^18.2.0","tailwindcss":"^3.4.0","typescript":"^5.2.2","vite":"^5.0.8","vite-plugin-dts":"^3.6.3","vite-plugin-lib-inject-css":"^1.3.0","vitest":"^1.1.0"},"dependencies":{"date-fns":"^3.0.6","lodash":"^4.17.21"},"gitHead":"3af5962d47fbb9d6d35a67f834c0524cffa4ab5d","description":"## Overview","_id":"@bruceshi/calendar-hook@0.0.2","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-8mvYKK1JCKw9VsZE0PhyxUtitcw+PiBQB3CNq3Z0QnS85P8+rC/oQb/GdOM3/OGv7IGJwCxX5S7ne5ny6GRSug==","shasum":"c8b854aad3be8891e93c3f6ea004b4e8e769de35","tarball":"https://registry.npmjs.org/@bruceshi/calendar-hook/-/calendar-hook-0.0.2.tgz","fileCount":6,"unpackedSize":23068,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBDVuFumt0GNnOGXr4aBbVy6Cb99W2j8gHhipynfvGCuAiEAn0njRbhGnMQzzR4UncboiLtYBqWWYIKqIeam24m9mWQ="}]},"_npmUser":{"name":"bruceshi","email":"shibocuhk@gmail.com"},"directories":{},"maintainers":[{"name":"bruceshi","email":"shibocuhk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/calendar-hook_0.0.2_1703839023704_0.29871060723614806"},"_hasShrinkwrap":false},"0.0.3":{"name":"@bruceshi/calendar-hook","private":false,"version":"0.0.3","author":{"name":"shibocuhk@gmail.com"},"type":"module","main":"dist/index.cjs.js","module":"dist/index.es.js","types":"dist/index.d.ts","scripts":{"dev":"vite","build":"tsc --p ./tsconfig-build.json && vite build","lint":"eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0","preview":"vite preview","test":"vitest"},"sideEffects":["**/*.css"],"peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"devDependencies":{"@testing-library/react":"^14.1.2","@types/lodash":"^4.14.202","@types/node":"^20.8.10","@types/react":"^18.2.43","@types/react-dom":"^18.2.17","@typescript-eslint/eslint-plugin":"^6.14.0","@typescript-eslint/parser":"^6.14.0","@vitejs/plugin-react":"^4.2.1","autoprefixer":"^10.4.16","daisyui":"^4.4.24","eslint":"^8.55.0","eslint-plugin-react-hooks":"^4.6.0","eslint-plugin-react-refresh":"^0.4.5","glob":"^10.3.10","jsdom":"^23.0.1","postcss":"^8.4.32","react":"^18.2.0","react-dom":"^18.2.0","tailwindcss":"^3.4.0","typescript":"^5.2.2","vite":"^5.0.8","vite-plugin-dts":"^3.6.3","vite-plugin-lib-inject-css":"^1.3.0","vitest":"^1.1.0"},"dependencies":{"date-fns":"^3.0.6","lodash":"^4.17.21"},"gitHead":"3af5962d47fbb9d6d35a67f834c0524cffa4ab5d","description":"## Overview","_id":"@bruceshi/calendar-hook@0.0.3","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-yM0Gp3uWaQg6rYYnCP32SBFzvm+fB/ZXB6BBH1Yt0Nj/vNRb50nLz2KfZF+xSiEXlIJTkBvteVSmgx0+OiC5Lw==","shasum":"1c7761333f505a85738656c0f8072daa71a5b373","tarball":"https://registry.npmjs.org/@bruceshi/calendar-hook/-/calendar-hook-0.0.3.tgz","fileCount":9,"unpackedSize":120884,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAJKYyHwrPaS+cnJTvuGiZbT8MyNV+p+5/3Xthbq62y0AiEAvwufDH4zFhylkbpl1yVHBcrR1G/43FVfYLs/BSTRImw="}]},"_npmUser":{"name":"bruceshi","email":"shibocuhk@gmail.com"},"directories":{},"maintainers":[{"name":"bruceshi","email":"shibocuhk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/calendar-hook_0.0.3_1703839763580_0.5799476471503882"},"_hasShrinkwrap":false},"0.0.4":{"name":"@bruceshi/calendar-hook","private":false,"version":"0.0.4","author":{"name":"shibocuhk@gmail.com"},"type":"module","main":"dist/index.cjs.js","module":"dist/index.es.js","types":"dist/index.d.ts","scripts":{"dev":"vite","build":"tsc --p ./tsconfig-build.json && vite build","lint":"eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0","preview":"vite preview","test":"vitest"},"sideEffects":["**/*.css"],"peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"devDependencies":{"@testing-library/react":"^14.1.2","@types/lodash":"^4.14.202","@types/node":"^20.8.10","@types/react":"^18.2.43","@types/react-dom":"^18.2.17","@typescript-eslint/eslint-plugin":"^6.14.0","@typescript-eslint/parser":"^6.14.0","@vitejs/plugin-react":"^4.2.1","autoprefixer":"^10.4.16","daisyui":"^4.4.24","eslint":"^8.55.0","eslint-plugin-react-hooks":"^4.6.0","eslint-plugin-react-refresh":"^0.4.5","glob":"^10.3.10","jsdom":"^23.0.1","postcss":"^8.4.32","react":"^18.2.0","react-dom":"^18.2.0","tailwindcss":"^3.4.0","typescript":"^5.2.2","vite":"^5.0.8","vite-plugin-dts":"^3.6.3","vite-plugin-lib-inject-css":"^1.3.0","vitest":"^1.1.0"},"dependencies":{"date-fns":"^3.0.6","lodash":"^4.17.21"},"gitHead":"3af5962d47fbb9d6d35a67f834c0524cffa4ab5d","description":"## Overview","_id":"@bruceshi/calendar-hook@0.0.4","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-nzwTzcYBuDDIPXPyrsWJmWCvfhXMD1YvVyk/vbQhBNHrjjU2acpya336WWN/E1E0YkLwO5qvChhMcz5vlU2kLA==","shasum":"c49546e8d0b199798136ca6859fba5fe5ce73802","tarball":"https://registry.npmjs.org/@bruceshi/calendar-hook/-/calendar-hook-0.0.4.tgz","fileCount":51,"unpackedSize":91158,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA7rybWhfPQ6noHyWBWzcCQAuvNx4A83Ua/kOTN40mavAiBCSB+3HK11EJ0U1DH2IsFvaL38+VicLB92s4YMxen5Xw=="}]},"_npmUser":{"name":"bruceshi","email":"shibocuhk@gmail.com"},"directories":{},"maintainers":[{"name":"bruceshi","email":"shibocuhk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/calendar-hook_0.0.4_1703840469125_0.4506467569724748"},"_hasShrinkwrap":false},"0.0.5":{"name":"@bruceshi/calendar-hook","private":false,"version":"0.0.5","author":{"name":"shibocuhk@gmail.com"},"type":"module","main":"dist/index.cjs.js","module":"dist/index.es.js","types":"dist/index.d.ts","scripts":{"dev":"vite","build":"tsc --p ./tsconfig-build.json && vite build","lint":"eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0","preview":"vite preview","test":"vitest"},"sideEffects":["**/*.css"],"peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"devDependencies":{"@testing-library/react":"^14.1.2","@types/lodash":"^4.14.202","@types/node":"^20.8.10","@types/react":"^18.2.43","@types/react-dom":"^18.2.17","@typescript-eslint/eslint-plugin":"^6.14.0","@typescript-eslint/parser":"^6.14.0","@vitejs/plugin-react":"^4.2.1","autoprefixer":"^10.4.16","daisyui":"^4.4.24","eslint":"^8.55.0","eslint-plugin-react-hooks":"^4.6.0","eslint-plugin-react-refresh":"^0.4.5","glob":"^10.3.10","jsdom":"^23.0.1","postcss":"^8.4.32","react":"^18.2.0","react-dom":"^18.2.0","tailwindcss":"^3.4.0","typescript":"^5.2.2","vite":"^5.0.8","vite-plugin-dts":"^3.6.3","vite-plugin-lib-inject-css":"^1.3.0","vitest":"^1.1.0"},"dependencies":{"date-fns":"^3.0.6","lodash":"^4.17.21"},"gitHead":"3af5962d47fbb9d6d35a67f834c0524cffa4ab5d","description":"## Overview","_id":"@bruceshi/calendar-hook@0.0.5","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-MZ/skU0tCe/me50hxiG3M83bdMk/xXLOIJ+ImRw7T/8OqIoOZKXEHV//enqczt3Pxt13HaMhY3lAeHa1DWJi5w==","shasum":"fc1a4aba0898ea7448f87ec983b2be11c9cf505f","tarball":"https://registry.npmjs.org/@bruceshi/calendar-hook/-/calendar-hook-0.0.5.tgz","fileCount":11,"unpackedSize":83884,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLaUALfoIAKKRmM6uqMdBiJMwY66E7F+zk3f7ufGEQjgIhAJGy8F3y43RNoqNr4KccTloazunG1BJbEXXuda+NOYpQ"}]},"_npmUser":{"name":"bruceshi","email":"shibocuhk@gmail.com"},"directories":{},"maintainers":[{"name":"bruceshi","email":"shibocuhk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/calendar-hook_0.0.5_1703840648797_0.9774348871850531"},"_hasShrinkwrap":false}},"time":{"created":"2023-12-29T08:18:40.217Z","0.0.1":"2023-12-29T08:18:40.479Z","modified":"2023-12-29T09:04:09.170Z","0.0.2":"2023-12-29T08:37:03.869Z","0.0.3":"2023-12-29T08:49:23.747Z","0.0.4":"2023-12-29T09:01:09.293Z","0.0.5":"2023-12-29T09:04:08.981Z"},"maintainers":[{"name":"bruceshi","email":"shibocuhk@gmail.com"}],"description":"## Overview","author":{"name":"shibocuhk@gmail.com"},"readme":"# Calendar Hook\n\n## Overview\n\nuseCalendar is designed for managing calendar-related functionalities within a React application. It provides an efficient way to handle dates, days, and events, making it ideal for applications that require calendar features. The hook is built using date-fns for date manipulation, ensuring a lightweight and functional approach.\n\n## Installation\n\n`yarn add @bruceshi/calendar-hook`\n\n## Usage\n\n\n```typescript\nimport { useCalendar } from '@bruceshi/calendar-hook';\n\nconst {\n  days,\n  weekdays,\n  next,\n  prev,\n  setView,\n  current,\n  setCurrent\n} = useCalendar(events);\n\n```\n### Args\n\n* events: An optional array of events to initialize the calendar.\n\n### Return Values\n\nThe hook returns an object containing the following properties:\n\n* `days`: An array of Day objects representing each day in the current view (month or week).\n* `weekdays`: An array of strings representing the days of the week.\n* `next`: A function to navigate to the next month or week.\n* `prev`: A function to navigate to the previous month or week.\n* `setView`: A function to set the calendar view ('month' or 'week').\n* `current`: The current date.\n* `setCurrent`: A function to set the current date.\n\n### Interfaces\n* `Event`: Represents an event with a date property.\n* `Day`: Represents a day in the calendar with properties such as date, format, isSameMonth, isToday, and events.","readmeFilename":"README.md"}