{"id":17472613,"url":"https://github.com/shinnn/count-days-in-month","last_synced_at":"2025-03-28T08:10:46.567Z","repository":{"id":57209774,"uuid":"62118750","full_name":"shinnn/count-days-in-month","owner":"shinnn","description":"Get the number of days in a given month","archived":false,"fork":false,"pushed_at":"2016-07-27T09:44:31.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-02T09:04:14.002Z","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/shinnn.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2016-06-28T07:14:43.000Z","updated_at":"2019-07-08T22:03:47.000Z","dependencies_parsed_at":"2022-08-29T11:41:04.057Z","dependency_job_id":null,"html_url":"https://github.com/shinnn/count-days-in-month","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fcount-days-in-month","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fcount-days-in-month/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fcount-days-in-month/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fcount-days-in-month/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shinnn","download_url":"https://codeload.github.com/shinnn/count-days-in-month/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245991582,"owners_count":20706129,"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-18T17:29:00.042Z","updated_at":"2025-03-28T08:10:46.531Z","avatar_url":"https://github.com/shinnn.png","language":"JavaScript","funding_links":[],"categories":["Modules","模块"],"sub_categories":["Date \u0026 Time","日期和时间"],"readme":"# count-days-in-month\n\n[![NPM version](https://img.shields.io/npm/v/count-days-in-month.svg)](https://www.npmjs.com/package/count-days-in-month)\n[![Bower version](https://img.shields.io/bower/v/count-days-in-month.svg)](https://github.com/shinnn/count-days-in-month/releases)\n[![Build Status](https://travis-ci.org/shinnn/count-days-in-month.svg?branch=master)](https://travis-ci.org/shinnn/count-days-in-month)\n[![Coverage Status](https://img.shields.io/coveralls/shinnn/count-days-in-month.svg)](https://coveralls.io/r/shinnn/count-days-in-month)\n[![Dependency Status](https://david-dm.org/shinnn/count-days-in-month.svg)](https://david-dm.org/shinnn/count-days-in-month)\n[![devDependency Status](https://david-dm.org/shinnn/count-days-in-month/dev-status.svg)](https://david-dm.org/shinnn/count-days-in-month#info=devDependencies)\n\nGet the number of days in a given month\n\n```javascript\ncountDaysInMonth(2016, 11); //=\u003e 31\ncountDaysInMonth(2016, 8); //=\u003e 30\n```\n\n## Installation\n\n### [npm](https://www.npmjs.com/)\n\n```\nnpm install count-days-in-month\n```\n\n### [bower](https://bower.io/)\n\n```\nbower install count-days-in-month\n```\n\n## API\n\n### countDaysInMonth(*fullYear*, *zeroBasedMonth*)\n\n*fullYear*: `Number` of [full year](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear), for example `2016`  \n*zeroBasedMonth*: `Number` of month, zero based (`0`, `1`, ... `11`)   \nReturn: `Number` of days\n\nIt returns a number of days in the month, considering the year is whether  a leap year or not.\n\n```javascript\ncountDaysInMonth(2015, 1); //=\u003e 28\ncountDaysInMonth(2016, 1); //=\u003e 29\n```\n\n## License\n\nCopyright (c) 2016 [Shinnosuke Watanabe](https://github.com/shinnn)\n\nLicensed under [the MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Fcount-days-in-month","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshinnn%2Fcount-days-in-month","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Fcount-days-in-month/lists"}