Hi,
I haven't tried this but it should be close:
var oNow = new Date();
var oDay = util.printd("dddd", oNow);
// add 25 working days and make new date object
if (oNow == "Saturday")
{
oNow = new Date(oNow.getFullYear(), oNow.getMonth(), (oNow.getDate() + 35 + 2));
}
else if (oNow == "Sunday")
{
oNow = new Date(oNow.getFullYear(), oNow.getMonth(), (oNow.getDate() + 35 + 1));
}
else
{
oNow = new Date(oNow.getFullYear(), oNow.getMonth(), (oNow.getDate() + 35));
}
// dispaly new date information
sMsg = "In 25 working days it will be " + util.printd("mm/dd/yyyy", oNow);
sMsg += "\n" + "The day of the week will be " + util.printd("dddd", oNow);
app.alert(sMsg, 3, 0);
The 35 is seven days for for each of the 5-day working weeks. The +2 and +1 push a weekend into the next working day.
Hope that works,
Niall
Assure Dynamics