Format snippets

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-10-22 20:23:47 +03:00
parent 3936a1d3b8
commit aedcded750
70 changed files with 185 additions and 101 deletions

View File

@ -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