Repost: Holidays in KDE SC 4.5

[Update: It seems this little blog and the weight of PlanetKDE was enough to bring my webhost to its knees and lead them to suspend my account.  I've changed the PNG's to JPG's so hopefully that reduces the load enough to keep me on their good side.  You should see the bandwidth graph spiking at 7-8pm Europe time :-) ]

I've blogged previously about the changes I've been making to the KHolidays library. The main improvement is the ability to calculate holidays using alternative calendar systems, such as the Hebrew, Hijri/Islamic or Jalali/Persian calendars. The holiday region files are also able to be split into geographical sub-regions such as States and Provinces, and embed metadata such as the language they are available in. Due to restricted time I wasn't able to complete all the new features I wanted, such as holiday classifications and multiple holiday regions, which would have allowed a better means of separating and controlling the display of different holiday types (e.g. civil and religious). Those will have to wait for SC 4.6, but the backend changes I have made are now visible to users so I thought I would show the results so far.

To do so I'll be using the Plasma calendar widget, which has seen some new features of it's own. The two big ones are displaying your PIM Events and To-do's via Akonadi (implemented by Frederick Gladhorn), and a new information pop-up that appears when you mouse-over a date rather than having to click it (implemented by Aaron Seigo). It will also try auto-detecting a default holiday region to use (also by Aaron). You can see the net effect effect here (ignore the plasmoidviewer frame :-):

Calendar Plasmoid in KDE SC 4.5Plasma calendar holiday popup

Here you can see a number of things at a glance:

  • Today is marked with a black halo
  • A selected date is marked with a blue halo
  • Holidays that are days off are marked with a red halo
  • Holidays that are not a day off are marked with a green halo
  • Events and To-do's and marked with a bold day number
  • The pop-up lists all holidays, Events, and Todo's for the day you hover over

There's still some polishing work and bug fixing to be done on this for SC 4.5 (e.g. the Event start and end date are not really needed), and we're likely to be looking at the whole appearance of the calendar in SC 4.6, so keep that in mind when commenting on the appearance :-).

The details for today also show up when you hover over the panel clock:

Plasma clock with todays holidays and events

The configuration hasn't changed much, other than displaying the language that the holiday region is available in which is useful for people living in multilingual countries. As already mentioned, in SC 4.6 the config will be a lot more flexible with the ability to choose multiple holiday regions and holiday classifications, and how these will affect the display of the holidays.

Holiday config dialog

New region files have been added for the following:

  • Israel, in English and Hebrew
  • Iran, in English and Farsi
  • Ireland, in Irish (thanks to Kevin Scannell)
  • Belarus (thanks to Andrey Yurkovsky)
  • Separate files for several French departments: French Guiana, Guadeloupe, Martinique, New Caledonia, French Polynesia, Réunion, Wallis and Futuna, and Mayotte (thanks to Pierre Buard)
  • Separate files for England and Wales, Northern Ireland, and Scotland (thanks to David Jarvie)
  • Separate files for all the Australian states: QLD, NSW, ACT, VIC, TAS, NT, SA, WA

Looking at some of these will illustrate the new features.

The file format supports optional holidays, which is useful in defining substitute holidays:

Substitute holidays

Here you can see holidays calculated in alternative calendar systems such as Hebrew, Jalali and Hijri, and displayed on either a Gregorian, Hebrew or Jalali calender:

Israel Hebrew HolidaysIsrael Gregorian Holidays

Iran Jalali HolidaysIran Gregorian Holiday

A number of other regions have been reviewed for accuracy with the help of the i18n teams, and this is where you can also help. If you have SC 4.5 Beta 2, you can check your national holidays in the Plasma calender for the next few years and raise a bug under kdepimlibs/KHolidays if you find any mistakes (you could also browse the region rule files at websvn). If your country, region or language isn't supported, also raise a wish requesting support. Please try include a link to a definitive source for your holiday rules, preferably in English so I can read it, otherwise I'll need your help in translating.

In particular, the Iran files are entirely a copy-and-paste from Wikipedia, I'd be grateful if someone could check them. Note that the Islamic holidays are calculated using the Civil version of the calendar so may differ by 1 day from the actual lunar calculations.  I'd also welcome lists of holidays for any other countries using alternative calendars to ensure the code works in as many cases as possible.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Hi

Thank you very mush for your work odysseus

Can you please add the Algerian holidays, as you can see the first table is for official days,

and the second is for the Islamic.

Best regards, Amine. 

How to send Holiday enteries

I was looking for a way to add my countries Holiday calendar enteries to the to the calendar plasma widget and I was not able to find any documented means on how to make this happen. Is there a way one can help the project by sending more calendar entries? please let me know the requirements and how to go about it.

Awesome!

Awesome!

Swiss holidays

Thx a lot for your work in the calender, dates and printing area. You're doing a great work!!!

Here is the link to the swiss holidays:

http://en.wikipedia.org/wiki/Public_holidays_in_Switzerland

To table shows the public holidays for each of the 26 cantons (states of Switzerland). Don't know if this is already possible in KDE.

Thx anyway

Just general note of

Just general note of appreciation of the quality of your blog posts: I love reading them, always well-written and very informative.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.