Closed acywu closed 8 years ago
I'll take a look either tonight or tomorrow morning. Is this also affecting v2? Surprised the tests didn't catch this 😮
@alexcywu all of those examples you posted seem correct to me.
Gonna close 'cause these calculations seem correct. Lmk if there are other date ranges you want me to check out @alexcywu !
When using the weekDays function,
The result may + 1 day when the startMoment and endMoment are both weekend AND when the endMoment is weekend.
Here are some testing results:
console.log(momentBusiness.weekDays(moment('08-05-2016','DD-MM-YYYY'),moment('15-05-2016','DD-MM-YYYY'))); // Actual Result = 5, Expected Result = 4
console.log(momentBusiness.weekDays(moment('09-05-2016','DD-MM-YYYY'),moment('14-05-2016','DD-MM-YYYY'))) // Actual Result = 5, Expected Result = 4
console.log(momentBusiness.weekDays(moment('07-05-2016','DD-MM-YYYY'),moment('13-05-2016','DD-MM-YYYY'))) // Actual Result = 4, Expected Result = 4 <-- This is correct