Constructor
new BusinessTime()
Initializes a new instance of the BusinessTime class.
- Source:
Methods
-
add(count, unit, date) → {Moment}
-
Adds a specified amount of time to that supplied date.
Parameters:
Name Type Description count
Number The number of units to add. unit
String The time unit string. date
Moment The starting Moment object. Now by default. - Source:
Returns:
- Type
- Moment
-
businessDayFromDate(days, date, forward) → {Moment}
-
Gets the business day from the provided date.
Parameters:
Name Type Description days
Number The number of days. date
Moment The starting Moment object. Now by default. forward
Boolean Whether the day should count up or down. False by default. - Source:
Returns:
- Type
- Moment
-
businessDiff(start, stop) → {Number}
-
Gets the time difference in bussiness days.
Parameters:
Name Type Description start
Moment The moment.js start date object. stop
Moment The moment.js stop date object. - Source:
Returns:
- Type
- Number
-
holidaysForYear(year) → {Array}
-
Gets the holidays for th supplied year
Parameters:
Name Type Description year
String The year. - Source:
Returns:
- Type
- Array
-
holidaysForYearRange(start, stop)
-
Gets the holidays for the supplied year range. Stop year IS inclusive.
Parameters:
Name Type Description start
Number The start year. stop
Number The stop year. - Source:
-
subtract(count, unit, date) → {Moment}
-
Subtracts a specified amount of time to that supplied date.
Parameters:
Name Type Description count
Number The number of units to subtract. unit
String The time unit string. date
Moment The starting Moment object. Now by default. - Source:
Returns:
- Type
- Moment