README.md

moment-business-days

This is a Moment.js plugin that allows you to work with only business days
(Monday to Friday). You can customize the working week, and also set custom dates for holidays to exclude them from
being counted as business days, for example national holidays.

Use localization to configure business days

var moment =require('moment-business-days');
moment.updateLocale('us', {
workingWeekdays: [1, 2, 3, 4, 5, 6]
});
// Defines days from 1 (Monday) to 6 (Saturday) as business days. Note that Sunday is day 0.// When omitting this configuration parameter, business days are based on locale default

API

The objects returned by methods are Moment.js objects (except .isBusinessDay() and .businessDiff()) so you can
handle them with Moment.js native methods.

.isHoliday() => boolean

Check if the date is among the holidays specified, and return true or false:

.monthNaturalDays() => Moment[]

Is like .monthBusinessDays(), but this method will include the weekends in it's response.

.monthBusinessWeeks() => Moment[][]

Retrieve an array of arrays, these arrays are the representation of a business weeks and each week (array) have it own
business days (Monday to Friday). There could be the case that one week (array) have less than 5 days, this is because
the month started in the middle of a week, for example: the first week of January 2015 has just two days,
Thursday 1st and Friday 2nd. Each day in the week arrays are Moment.js objects.