[Kde-pim] KHolidays regions

John Layt jlayt at kde.org
Wed Jun 18 23:29:57 BST 2014


On 17 June 2014 23:42, John Layt <jlayt at kde.org> wrote:

> There were two types of categories I wanted to add that would have
> separate enums and api methods:
> * Holiday Class, e.g. Civil, Religious, Commemorative, Name, etc.
> * Holiday Type, e.g. National Day Off, Regional Day Off, School Day Off, etc.
>
> I was still trying to figure out how to split or combine these and how
> to name them.  Would you allow a holiday to be tagged with multiple
> Classes and multiple Types, or only a single one of each?  Would Type
> have a hierarchy, i.e. National Day Off implies Regional and School
> and Financial days off, or would we have to list every applicable Type
> for every holiday?  Or would we just merge Class and Type in the files
> and allow multiples of all tags, then split them later in the api?  Do
> we have a single Religious Class, or do we need a Class for each
> religion to allow people to choose which they want?  For Public /
> Statutory holidays do we have that as a Class as well as a Type, or is
> that just redundant?  What happens if a National Day Off is for a
> Religious holiday and a user chooses not to show Religious holidays?
...
> * Modify the file format to replace the two "color" fields with the
> two category fields, one field for a single pre-defined Holiday Type
> keyword, one for a list of one or more pre-defined Holiday Class
> keywords.  This would involve modifying the file parser written in
> bison/flex which is always a tricky process.
> * Repurpose the "stringcolor" field to have 1 category only allowed
> per holiday.  Currently this field has valid values of various colors,
> but also the value "weekend" which is the only value we now use to
> mean it is a day off.  We could fairly easily change the allowed
> values to be the category names instead of colors, with "public" being
> the special case that means a day off.  Again that's a change to the
> file parser, albeit a lot simpler.

OK, I spent a couple hours thinking about this, and decided that for
KHolidays and KDE4 the easiest option was to just implement support in
the file format for an extra field for categories, requiring one or
more categories to be assigned to every holiday.  The more advanced
type of day off I'll save for later.  The initial list of keywords
I've implemented are:

public
civil
religious
school
government
financial
cultural
commemorative
historical
nameday
seasonal

The "public" keyword has the extra meaning of being a day off in the
geographic region defined by the file.

As an example, here's Christmas:

    "Christmas Day" public religious on december 25

If you'd like to see more categories, or think the names need
changing, then speak now :-)  In particular, I'll like to know if
people think we need sub-categories of Religious holidays for the
separate denominations, e.g. religious-jewish-reform,
religious-roman-catholic, etc?

I'm currently working my way through the files tagging them all, then
I'll add the new api to the class and modify the widget.

Cheers!

John.
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list