Substract the specified number of business days (mon - fri) to the given date.
Substract the specified number of business days (mon - fri) to the given date, ignoring weekends.
// CommonJS var subBusinessDays = require('date-fns/subBusinessDays')
// ES 2015 import subBusinessDays from 'date-fns/subBusinessDays'
// ESM import { subBusinessDays } from 'date-fns'
subBusinessDays(date, amount)
Name | Description |
---|---|
date |
the date to be changed |
amount |
the amount of business days to be subtracted. Positive decimals will be rounded using |
Description |
---|
the new date with the business days subtracted |
Type | Description |
---|---|
TypeError |
2 arguments required |
// Substract 10 business days from 1 September 2014: const result = subBusinessDays(new Date(2014, 8, 1), 10) //=> Mon Aug 18 2014 00:00:00 (skipped weekend days)
© 2021 Sasha Koss and Lesha Koss
Licensed under the MIT License.
https://date-fns.org/v2.29.2/docs/subBusinessDays