{"_id":"@aborile/week-of-month","name":"@aborile/week-of-month","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@aborile/week-of-month","version":"1.0.0","description":"Calculate the week number of month (based on ISO 8601, DayJs)","keywords":["week","week-number","week-of-month","iso-week","dayjs"],"main":"src/index.ts","repository":{"type":"git","url":"git+https://github.com/aborile/week-of-month.git"},"license":"MIT","author":{"name":"aborile"},"scripts":{"test":"jest src/index.test.ts"},"dependencies":{"dayjs":"^1.11.12"},"devDependencies":{"@types/jest":"^29.5.12","jest":"^29.7.0","ts-jest":"^29.2.4","typescript":"^5.5.4"},"gitHead":"4c8cabbf1a2a74b5f8b3c8b3b7515004e89c8106","bugs":{"url":"https://github.com/aborile/week-of-month/issues"},"homepage":"https://github.com/aborile/week-of-month#readme","_id":"@aborile/week-of-month@1.0.0","_nodeVersion":"18.18.2","_npmVersion":"8.1.0","dist":{"integrity":"sha512-LlTaaH5w9FiuutiM6GnkRrVk2uhiz/vo1KThJBW2YugXwAEdD/gR9rWcpEn6kgivzosPW4Hl9kh1/DgBJngrRA==","shasum":"2e4eb4cb755c6ed597eeb290214ac989e2fce48a","tarball":"https://registry.npmjs.org/@aborile/week-of-month/-/week-of-month-1.0.0.tgz","fileCount":7,"unpackedSize":14477,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCotdgpEnenzbXXigZTp3tWgpKNl+CQy0cddpGfv57gNgIhAI1AKs1DJ+GRIPKRVekf4pTGmSxSgsinVWjtdqwf0jbu"}]},"_npmUser":{"name":"aborile","email":"able312@korea.ac.kr"},"directories":{},"maintainers":[{"name":"aborile","email":"able312@korea.ac.kr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/week-of-month_1.0.0_1723222416426_0.11681286242004396"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-09T16:53:36.303Z","1.0.0":"2024-08-09T16:53:36.568Z","modified":"2024-08-09T16:53:36.852Z"},"maintainers":[{"name":"aborile","email":"able312@korea.ac.kr"}],"description":"Calculate the week number of month (based on ISO 8601, DayJs)","homepage":"https://github.com/aborile/week-of-month#readme","keywords":["week","week-number","week-of-month","iso-week","dayjs"],"repository":{"type":"git","url":"git+https://github.com/aborile/week-of-month.git"},"author":{"name":"aborile"},"bugs":{"url":"https://github.com/aborile/week-of-month/issues"},"license":"MIT","readme":"# @aborile/week-of-month\n\n## Installation\n\n```bash\nyarn add @aborile/week-of-month\n```\n\nor\n\n```bash\nnpm install @aborile/week-of-month\n```\n\n## Definition\n\n> The [ISO 8601 definition](https://en.wikipedia.org/wiki/ISO_week_date) for week 01 is the week with the first Thursday of the Gregorian year (i.e. of January) in it.\n>\n> Weeks start with Monday and end on Sunday.\n\nBased on this definition, week 01 of the month is the week with the first Thursday of the month in it. This library will calculate the week number of month by checking when the start date of the month is (and checking the week number of the last week of previous month, if necessary).\n\nPlease note that this library follows ISO 8601 definition, so **weeks start with Monday**.\n\nFor example, the week numbers of August, 2024 and September, 2024 are as follows:\n\n```\n[ August, 2024 ]\nMo Tu We Th Fr Sa Su\n          1  2  3  4 : Aug / Week 01\n 5  6  7  8  9 10 11 : Aug / Week 02\n12 13 14 15 16 17 18 : Aug / Week 03\n19 20 21 22 23 24 25 : Aug / Week 04\n26 27 28 29 30 31    : Aug / Week 05\n```\n\n```\n[ September, 2024 ]\nMo Tu We Th Fr Sa Su\n                   1 : Aug / Week 05\n 2  3  4  5  6  7  8 : Sep / Week 01\n 9 10 11 12 13 14 15 : Sep / Week 02\n16 17 18 19 20 21 22 : Sep / Week 03\n23 24 25 26 27 28 29 : Sep / Week 04\n30 31                : Oct / Week 01\n```\n\n## Usage\n\n```typescript\nimport { getWeekOfMonth } from \"@aborile/week-of-month\";\n\nconst { month, week } = getWeekOfMonth(\"2024-08-01\"); // month: 8, week: 1\n\nconsole.log(`The '2024-08-01' is Week ${week} on Month ${month}`);\n```\n","readmeFilename":"README.md"}