[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-pim
Subject: [Kde-pim] Re: [kdepim-users] Format of KOrganizer's holidays files
From: Allen Winter <winter () kde ! org>
Date: 2005-03-18 21:59:15
Message-ID: 200503181659.15713.winter () kde ! org
[Download RAW message or body]
On Friday 18 March 2005 02:46 pm, Alejandro Exojo Piqueras wrote:
> Hi.
>
> I'm really happy to see that KOrganizer automatically recognizes many spanish
> holidays. Awesome!
>
> However, some of them are not 100% correct, so I'm working with the rest of
> the spanish i18n team to fix them, and make it more complete (to include also
> the the holidays of the local autonomic communities).
>
> So I will need a bit of help in the format of the holidays_* files. Reading
> the code, it seems that it comes from "plan", but I haven't found anything
> about the format itself, and since I don't know lex/yacc or whathever it is,
> the source didn't helped here.
>
I found the following in the plan documentation. Hope it helps.
BTW: I had started working on an entirely new holidays library
for KDE with XML formatted holiday files. That project is on hold.
The holiday format is: (optional parts are in [square brackets],
nonterminals are in CAPS, alternatives are separated by |, everything
must be entered in lower case)
[small] [STRINGCOLOR] "name" [DAYNUMBERCOLOR]
on [DATE] [OFFSET] [LENGTH]
(Although shown here on two lines, every holiday definition must be
entered on a single line.)
Available colors are black, red, green, yellow, blue, magenta, cyan,
white, and weekend (the same color used for Saturday and Sunday).
The string color is used for the name when printed into a day box; the
day number color is used to alter the color of the day number (1..31)
of the day box the holiday falls on. This can be used to promote a day
to an official holiday by using the "weekend" color. If there is a day
number color specified, but no string color, the string color is set to
the day number color. The name can be empty, but the quotes must be
present. There are several formats for DATE:
DAY . MONTH [ . YEAR]
MONTH / DAY [ / YEAR]
DAY MONTHNAME [YEAR]
MONTHNAME DAY [YEAR]
[every NTH] WEEKDAY [in MONTH]
WEEKDAY before LIT_DATE
WEEKDAY after LIT_DATE
easter
pascha
DAY, MONTH, YEAR, NTH, and NUMBER can be C expressions; in
dates, they must be parenthesized. The special values any and last are
also available. Any valid DATE description specifying a single day may
be converted to a NUMBER by enclosing it in square brackets [].
MONTHNAME is january, february, etc; WEEKDAY is monday, tuesday,
etc. NTH can alternatively be first, second, ..., fifth, last. The
words on, every, day, and days are syntactic sugar without meaning.
Easter is predefined because its definition is rather complicated.
LIT_DATE stands for one of the first two alternatives, DAY.MONTH[.YEAR]
or MONTH/DAY[/YEAR]. Pascha is the Christian Orthodox Easter.
The OFFSET after DATE is "[plus | minus NUMBER days", and
the LENGTH after that is "length NUMBER days". Offsets are
useful for holidays relative to Easter, and lengths are useful for trade
shows and vacations. Always define vacations last in the list so regular
holidays override them.
Dates can be converted to numbers by enclosing them in square brackets.
For example, the number of days between Easter and May 1 can be
computed with ([may 1] - [easter]). As with C expressions, bracketed
expressions must be parenthesized.
If you have /lib/cpp (see CPP_PATH in the Makefile), you can use #include
statements to include additional external holiday files. The external files
cannot be edited interactively with plan; use an editor.
Examples:
small "Easter" weekend on easter
small "Surprise" blue on last sunday in april plus 1 day
small green "xmas" weekend on 12/25
"" weekend on july 4
magenta "Payday" on any/last
green "Vacation" on 20.6.93 length 28 days
#include "/usr/local/lib/vacations"
Restrictions: plus, minus, and length may not cross over to the next or
previous year, you cannot define New Year's as "last/last plus 1 day".
--
Let's Keep the Political Talk Out of KDE PLEASE
_______________________________________________
kde-pim mailing list
kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic