Format snippets
This commit is contained in:
@ -11,15 +11,13 @@ Calculates the date after adding the ginen number of business days.
|
||||
- **NOTE:** Does not take official holidays into account.
|
||||
|
||||
```js
|
||||
const addWeekDays = (startDate, count) =>
|
||||
Array
|
||||
.from({ length: count })
|
||||
.reduce(date => {
|
||||
date = new Date(date.setDate(date.getDate() + 1));
|
||||
if (date.getDay() % 6 === 0)
|
||||
date = new Date(date.setDate(date.getDate() + ((date.getDay() / 6) + 1)));
|
||||
return date;
|
||||
}, startDate);
|
||||
const addWeekDays = (startDate, count) =>
|
||||
Array.from({ length: count }).reduce(date => {
|
||||
date = new Date(date.setDate(date.getDate() + 1));
|
||||
if (date.getDay() % 6 === 0)
|
||||
date = new Date(date.setDate(date.getDate() + (date.getDay() / 6 + 1)));
|
||||
return date;
|
||||
}, startDate);
|
||||
```
|
||||
|
||||
```js
|
||||
|
||||
Reference in New Issue
Block a user