
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
How many natural days does April has? How many business days does February has? How many Holidays are there in December? How many Weeks does June has? How many Sundays in September?
ThisMonth is an small utility class that provides useful methods to get calculations and details of an specific month.
npm install this-month --save
or
yarn add this-month
const ThisMonth = require('this-month').default;
// ES6
import ThisMonth from 'this-month';
const february = new ThisMonth({
year: 2017,
month: 2
})
const totalDays = february.numberOfNaturalDays(); // 28
const totalBusinessDays = february.numberOfBusinessDays(); // 19 (Using default days off - Sat, Sun)
| Option | Type | Description | Required |
|---|---|---|---|
| year | int | Year of the month | yes |
| month | int | Month of the year | yes |
| daysOff | array | Names of weekly days off | No |
| holidays | array | Holiday dates in the year | No |
const december = ThisMonth({
year: 2017,
month: 12,
daysOff: ['Monday'], // working days Tuesday - Sunday,
holidays: ['2017-12-25', '2017-12-31'] // you can also list all the holiday dates of the year
})
december.numberOfNaturalDays(); // 31
december.numberOfBusinessDays(); // 26 (4 Mondays are off and 2 holidays, but the 25th is Monday so it's already off day)
| Method | Description |
|---|---|
| weeklyDaysOff | Returns string of day numbers. |
| numberOfWeeks | Returns number of weeks in the month |
| numberOfNaturalDays | Returns number of days in the month |
| numberOfDaysOff | Returns number of days in the month |
| numberOfHolidays | Returns number of days in the month |
| numberOfBusinessDays | Returns number of days in the month |
| numberOfSundays | Returns number of days in the month |
| numberOfMondays | Returns number of days in the month |
| numberOfTuesdays | Returns number of days in the month |
| numberOfWednesdays | Returns number of days in the month |
| numberOfThursdays | Returns number of days in the month |
| numberOfFridays | Returns number of days in the month |
| numberOfSaturdays | Returns number of days in the month |
FAQs
Utility library to get details about an specific month.
We found that this-month demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.