FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.



Dec 21, 2014, 11:28 AM
51 Posts
topic has been resolvedResolved

Calculating working days between two dates

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.3
  • Role: Administrator,Developer,End User
  • Tags: Calculating working days between two dates
  • Replies: 2

Dear All,

Let me know how to find working days between two days after excluding weekends and holidays in xpages.

Please help.

Dec 21, 2014, 1:09 PM
110 Posts
Evaluate the @BusinessDays

var startdate = "@Date(2014;12;1)";

var enddate = "@Date(2014;12;31)";
var weekends = "1:7"; //assuming your weekend is Saturday and Sunday
var holidays = "@Date(2014;12;24):@Date(2014;12;25)"; // assuming your holiday is 24th and 25th December
var formula = "@BusinessDays(" + startdate + ";" + enddate + ";" + weekends + ";" + holidays + ")";
return session.evaluate(formula);

Dec 22, 2014, 3:53 AM
51 Posts
@BusinessDays

Thank you, it is working.


FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.