API Reference
BusinessDays.HolidayCalendar
— TypeAbstract type for Holiday Calendars.
BusinessDays.easter_rata
— FunctionBusinessDays.easter_date
— Functioneaster_date(y::Dates.Year) → Dates.Date
Returns result of easter_rata
as a Dates.Date
instance.
BusinessDays.findweekday
— Functionfindweekday(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.
BusinessDays.isholiday
— Functionisholiday(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
.
isholiday(cal::DE, dt::Dates.Date)::Bool
Return true if dt
is a is a holiday in the German calender (cal
), otherwise false.
BusinessDays.isweekend
— Functionisweekend(dt) :: Bool
Returns true
for Saturdays or Sundays. Returns false
otherwise.
BusinessDays.isweekday
— Functionisweekday(dt) :: Bool
Returns true
for Monday to Friday. Returns false
otherwise.
BusinessDays.isbday
— Functionisbday(calendar, dt) :: Bool
Returns false
for weekends or holidays. Returns true
otherwise.
BusinessDays.tobday
— Functiontobday(calendar, dt; [forward=true]) :: Dates.Date
Adjusts dt
to next Business Day if it's not a Business Day. If isbday(dt)
, returns dt
.
BusinessDays.advancebdays
— Functionadvancebdays(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.
BusinessDays.bdays
— Functionbdays(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.
BusinessDays.bdayscount
— Functionbdayscount(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.
BusinessDays.firstbdayofmonth
— Functionfirstbdayofmonth(calendar, dt) :: Dates.Date
firstbdayofmonth(calendar, yy, mm) :: Dates.Date
Returns the first business day of month.
BusinessDays.lastbdayofmonth
— Functionlastbdayofmonth(calendar, dt) :: Dates.Date
lastbdayofmonth(calendar, yy, mm) :: Dates.Date
Returns the last business day of month.
BusinessDays.listholidays
— Functionlistholidays(calendar, dt0::Dates.Date, dt1::Dates.Date) → Vector{Dates.Date}
Returns the list of holidays between dt0
and dt1
.
BusinessDays.listbdays
— Functionlistbdays(calendar, dt0::Dates.Date, dt1::Dates.Date) → Vector{Dates.Date}
Returns the list of business days between dt0
and dt1
.
BusinessDays.initcache
— Functioninitcache(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.
BusinessDays.cleancache
— Functioncleancache([calendar])
Cleans cache for a given instance or list of HolidayCalendar
, Symbol
or AbstractString
.