Monday, October 30, 2006

Omitting holidays from @BusinessDays

Domino Administrator allows you to create holidays that users can download to their own calendars. The next logical step is to include this in calculations where you need business days, but you don't want to include holidays. Here's how to do it in Formula:
dateHolidays := @DbColumn("":"Cache";"mail":"names.nsf";"Holidays";2);
intBusDays := @BusinessDays(StartDate;EndDate;1 : 7; dateHolidays)
This omits Saturdays, Sundays, and the list of dates in the Holidays view. You may consider adding some logic to filter out only holidays for the current year, depending on your requirements. Also be aware that the view only lists the first date entered in the repeating date field. If you have the holiday set to repeat you will have to account for this.

This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.

No comments:

Post a Comment