2
votes

Can anyone help me to come up with a formula to: (1) subtract dates in xpages [not in lotus client] I am a beginner in xpages with no experience in xpages javascript or xpages expression language.

(2) If possible can anyone also help me compute for the Business Days in xpages because there is no @BusinessDays function in xpages.

Hope someone could help me. Many thanks in advance!

2

2 Answers

2
votes

(1) subtract dates in xpages [not in lotus client] I am a beginner in xpages with no experience in xpages javascript or xpages expression language.

I found this on an IBM wiki site, tested and it works:

timeDifference

This computed field returns the number of days since the current document was created.

var doc:NotesDocument = currentDocument.getDocument();
var created:NotesDateTime = doc.getCreated();
var now:NotesDateTime = session.createDateTime("Today 12");
now.setNow();
var days:int = now.timeDifferenceDouble(created) / 86400; // 86400 seconds in a day
return "This document was created "  + Math.floor(days) + " days ago."
1
votes

1) http://markalexanderbain.suite101.com/have-a-date-with-javascript-a85811

2) You'll need a database or some kind of access to a calendar so you can skip public holidays in addition to weekends.