SSJS Extension – New Function: @GetNextBusinessDayExt()

I have added a new @Function to my SSJS project on OpenNTF.

Syntax

@GetNextBusinessDayExt( [offset] ; [baseDate] ; [excludedDaysOfWeek] ; [excludedDates] )

Parameters

offset:
Number of non-excluded days from the baseDate that the result date will be

basedate:
Date to start counting offset from. If specify “null” defaults to today

excludedDaysOfWeek:
Numer or number list. Optional. Days of the week not counted as business days, where 1 is Sunday and 7 is Saturday.
DEFAULT: 1,7 ( Sunday, Saturday )

excludedDates:
String of date strings (formatted as <CODE>SimpleDateFormat.getDateInstance().format(</CODE>)) which represent specific dates which should be excluded from the counting of days, such as holidays

Return value:
The earliest date which is offset days after the baseDate. InĀ  counting towards this result date, any excludedDaysOfWeek and any excludedDates are excluded from counting towards the offset