Check any date or date vector for is an official day off or not.
check_dayoffs(date = NULL,
year = NULL,
month = NULL,
day = NULL,
cc = getOption("timeperiodsR.official_day_offs_country"),
pre = getOption("timeperiodsR.official_day_offs_pre"),
include_custom_day_offs = TRUE)
Named vector with date and marks
Year for check
Month for check
Month for check.
Date, or date vector for checking
Country, one of ru, ua, kz, by
Including shorter working days, 0 or 1
Including custom dayoffs from options or global variables
Alexey Seleznev
Function use 'isDayOff() API'.
For get official day offs for your country you must install httr package and switch options timeperiodsR.official_day_offs
to TRUE or set system variable TPR_DAY_OFFS=TRUE
.
Now allow next country:
Russia
Ukraine
Kazakhstan
Belarus
Also you can set default country by options or systen envarible:
timeperiodsR.official_day_offs_country
TPR_COUNTRY
And you can include or exclude shorter working days. Using option timeperiodsR.official_day_offs_pre
:
Exclude shorter work days
Include shorter work days
Day marks:
Workday
Day off
Shorten day off
Custom day off
You can set your custom day offs, for example it can be your vacation. Using option timeperiodsR.custom_day_offs
or system variable TPR_CUSTOM_DAY_OFFS
. In TPR_CUSTOM_DAY_OFFS
you can set custom day offs like comma or semicolon list of dates in format YYYY-MM-DD
.
ld <- next_n_weeks(n = 2)
check_dayoffs(date = ld)
Run the code above in your browser using DataLab