I'm trying to get the next business day with my code, but it's not working correctly. It's just showing the next day. I've tried to check other questions to find the error, but I still can't figure it out.
This question applies to my own but not exactly:
How to exclude weekends between two dates using Moment.js
$scope.businessDay = new Date();
if (moment().day() === 5) { // friday, show monday
// set to monday
$scope.businessDay=moment().weekday(8).format("MMMM Do YYYY");
}
if (moment().day() === 6) { // saturday, show monday
// set to monday
$scope.businessDay=moment().weekday(8).format("MMMM Do YYYY");
}
else { // other days, show next day
$scope.businessDay= moment().add('days', 1).format("MMMM Do YYYY");
}