javascript add day to date
function addDays(date, days) {
var result = new Date(date);
result.setDate(result.getDate() + days);
return result;
}
javascript add day to date
function addDays(date, days) {
var result = new Date(date);
result.setDate(result.getDate() + days);
return result;
}
javascript add business days to date
function add_bus_days(date, busDays) { // add business days to a date
var wkdy = date.getDay(); // get weekday number
var addDays = wkdy >= 3 ? (busDays + 2) : busDays; // if it's wednesday or later set add days to 5 instead of 3 to account for the weekend
date.setDate(date.getDate() + addDays); // add days to current date
return date
}
// usage
var dt = new Date(); // get date
newDate = add_bus_days(dt, 3) // add 3 business days
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us