Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const getBusinessDays = (startDate, endDate) => {
- let days = Math.round(startDate.diff(endDate, 'days') - startDate .diff(endDate, 'days') / 7 * 2);
- if (endDate.day() === 6) {
- days--;
- }
- if (startDate.day() === 7) {
- days--;
- }
- return Math.abs(days);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement