[Kde-pim] RFC: Add Working Week and Day of Pray to KLocale

Allen Winter winter at kde.org
Tue Nov 4 13:52:34 GMT 2008


On Tuesday 04 November 2008 2:31:06 am John Layt wrote:
> [Copied to kdepim and i18n lists for their thoughts, please reply on k-c-d]
> 
> I want to propose some additions to KLocale to provide more accurate calendar 
> functions and improve the colouring of calendar widgets.  It's a very simple 
> change, but as it's KLocale I thought I would run it past everyone first.
> 
> Currently, the KDEUI::KDateTable calendar widget is hard-coded to colour the 
> Saturday and Sunday headers as the weekend whenever the calendar system is 
> Gregorian, and colour only KCalendarSystem::weekDayOfPray() as the weekend 
> when it's not, i.e. Hijri, Jalali, and Hebrew calendar users only get a one 
> day weekend.  KOrganizer::KoDayMatrix does something similar.  However, as the 
> following quote from Wikipedia [1] makes clear, the definition of working week 
> is not universal and is actually a function of Locale and not Calendar System:
> 
> "In Muslim-majority countries the legal work week in the Middle East is 
> typically either Saturday through Wednesday (as in Algeria and Saudi Arabia), 
> Saturday through Thursday (as in Iran) or Sunday through Thursday (as in 
> Egypt, Syria, United Arab Emirates) However, in secular Turkey and Lebanon the 
> work week is Monday through Friday, as in Western countries."
> 
> It would seem logical then to add the start and end of the working week to the 
> locale.  KOrganiser allows you to select each individual working day but I 
> don't think this is needed at locale level.
> 
> KCalendarSystem::weekDayOfPray() is also problematic as the Gregorian 
> calendar is used in many locales which are not predominantly Christian and so 
> users may want a different day coloured for religious observance (e.g. 
> Turkey), or an individual may belong to a religion that chooses a different 
> day of observance than the Calendar System used in their country (e.g.  
> Seventh Day Adventists).  There are also those who may not want such a day 
> displayed.  This also seems logical to be added to the locale.
> 
> I've made the following changes:
> 

Good ideas.

In the setters, I see you set default values if the input values are out-of-range.
I think you should just return without changing anything if the input is bogus.

In general, I have no objections and think you are correct.

> The kdepim guys can choose how they want to use this in KoDayMatrix, but I 
> would suggest a consistent behaviour.
> 
Agree about consistency.  Would you have time to work on this for KOrganizer?

> Going further, I'm sure many users would want to see their locale's public 
> holidays displayed as well in things like the panel clock/calendar, and even 
> their full PIM data.  I feel this would be too much for the kdelibs widget to 
> support, especially as KOrganiser::KoDayMatrix already supports all this, and 
> apps/widgets can choose to use that instead.  The problem here is that while 
> KHolidays is in kdepimlibs, 

No, libkholidays is in kdepim.  And it can't move to kdepimlibs due to licensing issues.
I have a long-standing to-do for major rewrites of the holidays stuff and move the
new library into kdepimlibs.

Part of that would be having  astronomical calculations (moonphases,
solstices/equinoxes, sunrise/sunsets...) put into kdelibs for use by
the calendarsystem and by the new kholidays.

The widgets and applets will follow that.

-Allen






More information about the kde-core-devel mailing list