API Reference

BusinessDays.findweekdayFunction
findweekday(weekday_target::Integer, yy::Integer, mm::Integer, occurrence::Integer, ascending::Bool) → Date

Given a year yy and month mm, finds a date where a choosen weekday occurs.

weekday_target values are declared in module Base.Dates: Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday = 1,2,3,4,5,6,7.

If ascending is true, searches from the beginning of the month. If false, searches from the end of the month.

If occurrence is 2 and weekday_target is Monday, searches the 2nd Monday of the given month, and so on.

source
BusinessDays.isholidayFunction
isholiday(calendar, dt) :: Bool

Checks if dt is a holiday based on a given calendar of holidays.

calendar can be an instance of HolidayCalendar, a Symbol or an AbstractString.

source
isholiday(cal::DE, dt::Dates.Date)::Bool

Return true if dt is a is a holiday in the German calender (cal), otherwise false.

source
BusinessDays.isbdayFunction
isbday(calendar, dt) :: Bool

Returns false for weekends or holidays. Returns true otherwise.

source
BusinessDays.tobdayFunction
tobday(calendar, dt; [forward=true]) :: Dates.Date

Adjusts dt to next Business Day if it's not a Business Day. If isbday(dt), returns dt.

source
BusinessDays.advancebdaysFunction
advancebdays(calendar, dt, bdays_count) :: Dates.Date

Increments given date dt by bdays_count. Decrements it if bdays_count is negative. bdays_count can be a Int, Dates.Day, Vector{Int}, Vector{Dates.Day} or a UnitRange.

Computation starts by next Business Day if dt is not a Business Day.

source
BusinessDays.bdaysFunction
bdays(calendar, dt0, dt1) :: Dates.Day

Counts the number of Business Days between dt0 and dt1. Returns instances of Dates.Day.

Computation is always based on next Business Day if given dates are not Business Days.

source
BusinessDays.bdayscountFunction
bdayscount(calendar, dt0, dt1) :: Int

Counts the number of Business Days between dt0 and dt1. Returns Int.

Computation is always based on next Business Day if given dates are not Business Days.

source
BusinessDays.firstbdayofmonthFunction
firstbdayofmonth(calendar, dt) :: Dates.Date
firstbdayofmonth(calendar, yy, mm) :: Dates.Date

Returns the first business day of month.

source
BusinessDays.lastbdayofmonthFunction
lastbdayofmonth(calendar, dt) :: Dates.Date
lastbdayofmonth(calendar, yy, mm) :: Dates.Date

Returns the last business day of month.

source
BusinessDays.listholidaysFunction
listholidays(calendar, dt0::Dates.Date, dt1::Dates.Date) → Vector{Dates.Date}

Returns the list of holidays between dt0 and dt1.

source
BusinessDays.listbdaysFunction
listbdays(calendar, dt0::Dates.Date, dt1::Dates.Date) → Vector{Dates.Date}

Returns the list of business days between dt0 and dt1.

source
BusinessDays.initcacheFunction
initcache(calendar, [d0], [d1])

Creates cache for a given Holiday Calendar. After calling this function, any call to isbday function, or any function that uses isbday, will be optimized to use this cache.

You can pass calendar as an instance of HolidayCalendar, Symbol or AbstractString. You can also pass calendar as an AbstractArray of those types.

source
BusinessDays.cleancacheFunction
cleancache([calendar])

Cleans cache for a given instance or list of HolidayCalendar, Symbol or AbstractString.

source