The QCAL /H
command and the
@PICKDATE
function highlight
holidays in a different color, and @ISHOLIDAY
tests whether a specific date matches a holiday. But what holidays does the
plugin recognize? A list of common United States
holidays is supplied by default, but it may be desirable to change or
replace this list. You can define custom holidays by creating a text file
named Holidays.ini in the same directory where ISO8601.DLL resides.
Holidays.ini will have one or more sections, each defining annual
holidays for a different country. Each section is identified by a header
line consisting of the English name of the country between square brackets,
e.g. [Latvia]
or [United Kingdom]
. The
plugin will use the appropriate section for your locale.
Each holiday is defined on a separate line within the appropriate section.
Use an asterisk as a placeholder for the year. When the calendar is
displayed, asterisks will be replaced with the year. Enter fixed dates in
ISO 8601 format (with an asterisk in place of the year): *-07-04
for the
Fourth of July, *-05-05
for
Cinco de Mayo,
*-11-05
for Guy
Fawkes Night. You can also use variable functions:
%@holiday[2,1,6,*]
for the
second
Monday in June, or %@easter[*,,,-2]
for Good Friday.
Do not omit the percent sign — it is required for
variable expansion!
Occasionally it is useful to restrict the years in which a holiday is
observed. You can define a year restriction at the start of the line; it must
be typed in parentheses, before the holiday definition. Two types of year
restrictions are supported: ranges and periods. A year range sets a
minimum or maximum year, or both; a periodic holiday occurs once every so
many years. Enter a year range as
(
start-
end)
,
e.g. (1868-1970)
to limit a holiday to the years
1868 through 1970. You may omit either the start
or the -
end; don’t type the minus
sign unless you specify an end.
An annual period is entered as (?
period=
remainder)
.
This defines a holiday observed only when the year divided by the
period leaves remainder.
For example, (?2=0)
restricts a holiday to even-numbered years,
and (?2=1)
to odd-numbered years. Where remainder
is zero, you may omit the =0
; (?4)
means
“in years evenly divisible by four.”
You can combine both types within one set of parentheses:
(1910-1935?2=1)
would select odd-numbered years between 1910
and 1935. As a practical example, since 1848 United States federal elections
have been held the day after the first Monday of November in even-numbered
years. We could define this date in Holidays.ini using:
[United States]
(1848?2) %@holiday[1,1,11,*,,1] ; Election Day
In Mexico, a new Presidente has taken office on the first of December every sixth year since 1934. (1934 divided by 6 leaves 2.)
[Mexico]
(1934?6=2) *-12-01 ; Transmisión del Poder Ejecutivo Federal
Note that the semicolon introduces a comment: the name of the holiday, displayed by
QCAL /L
.