Closed rotimi-best closed 4 years ago
This has to do with timezone. The internal date is represented as UTC, that's why it is the day before at 22:00 (10pm). I assume you're 2 hours after UTC where you are. If you are logging in the following way you get the "right" date:
console.log(moment(currentDate, 'DD-MM-YY').startOf('day').businessAdd(2).format('DD-MM-YY') // 04-11-19
Of course you can use _d.toTimeString() or _d.toDateString() to get the representation you want. Anyway 2019-11-03T22:00:00.000Z
that you got is till correct. Is midnight of Monday where you are.
Case 1
If today is Friday and I add 1 day it gives me Sunday. Shouldn't it be Monday if Sunday and Saturday are not business days.
Case 2
If today is Saturday and I add 2 days I expect it to skip sunday. Meaning I should get Tuesday but instead I get Monday.
Please let me know what you think about the following cases.