{"id":16244610,"url":"https://github.com/indexzero/month-ends","last_synced_at":"2025-03-19T18:33:18.749Z","repository":{"id":57302617,"uuid":"106508113","full_name":"indexzero/month-ends","owner":"indexzero","description":"Purposefully simple and dependency free functions for calendar months","archived":false,"fork":false,"pushed_at":"2018-01-18T19:12:31.000Z","size":8,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-18T21:04:11.817Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/indexzero.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-11T05:05:55.000Z","updated_at":"2024-07-03T09:11:28.000Z","dependencies_parsed_at":"2022-09-13T07:13:12.884Z","dependency_job_id":null,"html_url":"https://github.com/indexzero/month-ends","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexzero%2Fmonth-ends","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexzero%2Fmonth-ends/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexzero%2Fmonth-ends/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexzero%2Fmonth-ends/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indexzero","download_url":"https://codeload.github.com/indexzero/month-ends/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244013981,"owners_count":20383713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T14:19:56.157Z","updated_at":"2025-03-19T18:33:18.463Z","avatar_url":"https://github.com/indexzero.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# month-ends\n\nPurposefully simple and dependency free functions for calendar months\n\n## Usage\n\n#### `monthEnds`\n``` js\nconst monthEnds = require('month-ends');\n\nconst start = new Date('2015-01-02');\nconst end = new Date('2015-04-12');\n\nconsole.dir(monthEnds(start, end));\n// [ [ 2015-01-01T05:00:00.000Z, 2015-01-31T05:00:00.000Z ],\n//  [ 2015-02-01T05:00:00.000Z, 2015-02-28T05:00:00.000Z ],\n//  [ 2015-03-01T05:00:00.000Z, 2015-03-31T04:00:00.000Z ],\n//  [ 2015-04-01T04:00:00.000Z, 2015-04-30T04:00:00.000Z ] ]\n```\n\n#### `lastDayOfMonth`\n``` js\nconst { lastDayOfMonth } = require('month-ends');\n\nlet anyDay = new Date('2015-06-07');\nlet end = lastDayOfMonth(anyDay);\nconsole.dir(end.toDateString());\n// 'Tue Jun 30 2015'\n```\n\n#### `firstDayOfMonth`\n``` js\nconst { firstDayOfMonth } = require('month-ends');\n\nlet anyDay = new Date('2015-06-07');\nlet end = firstDayOfMonth(anyDay);\nconsole.dir(end.toDateString());\n// 'Mon Jun 01 2015'\n```\n\n#### `firstDayOfNextMonth`\n``` js\nconst { firstDayOfNextMonth } = require('month-ends');\n\nlet anyDay = new Date('2015-06-07');\nlet end = firstDayOfNextMonth(anyDay);\nconsole.dir(end.toDateString());\n// 'Wed Jul 01 2015'\n```\n\n## Tests\n\nTests are written with `mocha`, `assume`, and `nyc`. They can be run with \n`npm`:\n\n``` sh\nnpm test\n\n// ...\n// ...\n// ...\n\n  11 passing (25ms)\n\n----------|----------|----------|----------|----------|----------------|\nFile      |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |\n----------|----------|----------|----------|----------|----------------|\nAll files |    95.45 |    83.33 |      100 |      100 |                |\n index.js |    95.45 |    83.33 |      100 |      100 |             43 |\n----------|----------|----------|----------|----------|----------------|\n```\n\n##### AUTHOR: [Charlie Robbins](https://github.com/indexzero)\n##### LICENSE: MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findexzero%2Fmonth-ends","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findexzero%2Fmonth-ends","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findexzero%2Fmonth-ends/lists"}