Blogs

  • Browse Blogs
  • My Blog
  • My Updates

Tags Help

  • View as cloud  | list

Similar Blogs

photo

Lotus Nut

58 Entries |  Chris Whisonant
Updated 
Ratings 3     Comments 90
photo

TexasSwede

51 Entries |  Karl-Henry Martinsso...
Updated 
No Ratings 0     Comments 51
photo

Yellow is the...

47 Entries |  Tim Tripcony
Updated 
No Ratings 0     Comments 14
photo

Uh Clem's Adm...

22 Entries |  Chris Mobley
Updated 
No Ratings 0     Comments 23
photo

Urs Meli

13 Entries |  Urs Meli
Updated 
No Ratings 0     Comments 4

Dogear Bookmarks

.Domino Framework

Blog Authors:  Peter Presnell  

All entries tagged with holidays

Working with Holidays

Peter Presnell  |    |  Tags:  holidays .dominoframework  |  Comments (0)

I have been working on a couple of applications recently which manage milestones.  In setting the milestones it is necessary to adjust them so that they do not fall on weekends or official government holidays.  To achieve this I have utilized some of the existing components of the .Domino Framework as well as extending the framework to provide a more complete solution.

  1. The .Domino Framework provides a ($Calendar) view that can be added to any application that needs to support business holidays.  This view displays the existing holidays and provides actions for importing holidays from a NAB or creating entries manually.
  2. A Domino.Applications.Holidays namespace (aka LotsScript Library) provides the business logic necessary to support the importing of holidays into the application.  The DominoDatabaseWithHolidays class is used to extend the NotesDatabase class and includes an ImportHolidays method.  This method makes use of the undocumented NotesCSEventOwnerDocument class to calculate dates for repeating holidays in a similar way to importing holidays into your PAB.
  3. Because I was unable to get the official government holidays added to the company's Domain Directory (NAB) it was necessary for me to create a separate database to define these holiday groups.  The Import Holidays method has therefore been defined to look for an External Dependency document defining the location of the "Holidays" database.  If this is not defined then the official NAB is used.
  4. The framework also contains the (ListResource) subform that is used by the Mail database to prompt the user to elect holiday categories to be imported.
  5. The DominoDatabaseWithHolidays class also has a BusinessHolidays function that returns a list of all the holidays found in the database.
  6. The Domino.@Functions namespace contains an atfBusinessDay function.  This accepts a date (or array of dates), a list of holidays and adjusts the date(s) so that they do not fall on a weekend or one of the listed holidays.  A boolean flag is used to indicate if a day should be moved forwards or backwards to avoid falling on a non-business day.

So... to adjust milestones so they do not fall on a non-business day:-

  1. Import relevant holidays from the NAB into the application
  2. Use the atfbusiness holiday function passing a list of holidays obtained using the DominoDatabaseWithHolidays.BusinessHolidays method.

The code for all these classes/methods will be available as part of the 0.6 beta release of the .Domino Framework (expected towards the end of this month).  Some of the code is already present in the 0.5 Beta release available at OpenNTF.org.


Skip to main content link. Accesskey S
IBM Lotus Connections Help Tools About

Tags

A tag is a keyword that is used to categorize an entry. To view the entries with a particular tag, click a tag name or enter a tag in the box.
The tag cloud indicates the frequency of tag use. Popular tags appear darkest. The slider control adjusts how many tags are displayed in the tag cloud.