The other hat I wear around these parts besides Printing is Calendar Systems (just don't ask how I got interested, a long story...), and I've found a bit of time to put some more work into them, as well as the plasma Calendar and Clock widgets.
I've posted previously about giving the plasma Calendar and Clock widgets the ability to set what calendar system to display. This is now in trunk for people to play with, so I thought it was time to add to our already supported list of calendar systems that people can display on their desktop.
My first target was the Indian National calendar, the official government calender for India, albeit one apparently not widely used (the Gregorian is the common civil calendar). While the various Indian religious calendars might be more useful in daily life, unfortunately these require various astronomical calculations that we don't yet support, or local observations that we may not be able to support.
The Indian National calculations on the other hand are fairly straight forward as it is very closly linked to the Gregorian calendar, with there being a fixed 78 year difference in the year numbers, a fixed 80 day difference between the start of the respective years, and synchronised leap years. One interesting feature is that the first year in the calendar is Year 0, which required some changes to the base class to support as none of our current calenders have one.
The big problem though was that our exisiting Gregorian calendar class copies QDate in only actually doing Gregorian calculations after 15 October 1582, before then it uses the Julian calendar calculations. Any earlier dates in the Indian calendar would be calculated wrong if I used that, so I first had to implement a 'pure' version of the Gregorian calendar to use as a basis. And while I was at it I thought it would be remiss of me not to do a 'pure' Julian calendar, which may be useful for members of some Orthodox Christian churches.
The end result you can see below is full support for the Indian National calendar, currently from 0000-01-01 through to 9999-12-30.
Yes, I realise that the week numbers are wrong in the year 0, that's an existing bug in our ISO week number code for all years < 1 that I have to fix.
Could I ask all our friends in India to have a play with it and let me know if there are any glaring errors? Just update trunk kdelibs and kdebase then run "plasmoidviewer calendar" or "plasmoidviewer digital-clock", go into the widget settings and change the Calendar to Indian National. It passes the tests I have here, but they are not yet comprehensive.
The other thing I need to ask is to confirm the month and weekday name transliterations I have used from the net are 'correct' (i.e. current best practice), and that the short forms I have invented are OK and not something rude :-) Is there a standard set of 3 char abbreviations I should be using?
The month names I've used from Wikipedia along with my made-up abbreviations are:
The weekday names I've used from somewhere are (starting from Monday):
So our supported list of calendars is now:
Note that the 'pure' Gregorian won't yet be offered as a choice to users as I'm concerned about the possible confusion from seeing Gregorian twice in the list, and with inconsistencies arising with anything using the existing Gregorian or QDate stuff. However, it is there for apps to use if they need to.
Now, I'm a strong believer in our translation and localisation being one of our greatest strengths and selling points, not only something that could see us 'winning' in markets that the big players just can't be bothered with, but also helping bring the benfits of computers and the net to people who might not otherwise be able to access them. Providing as many local calendar systems as possible is part of that. So how do we compare at the moment to the competition?
OSX 10.5 lets you choose any of the following:
As the only OS to currently support the Buddist calendar, I suspect Steve Jobs was behind that feature :-)
Windows Vista and 7 has a real brain-dead scheme when it comes to Calendar Systems. Want an English desktop and the Hijri or Hebrew calendar? Sorry, no can do! You have to choose Arabic or Hebrew as your language, then it lets you choose which calendar system to use. It restricts what calendar(s) you are allowed to choose from based on first your language and second your country, which while good for choosing default values seems seriously restrictive for no good reason. And their desktop 'Gadget' will only display the global calendar. Fail. Anyway, according to MSDN the supported calendars are:
Actually, I'd better be careful with throwing the insults Microsofts way, because Gnome I'm sorry to say apparently gives you even less choice. Far as I can tell, Gnome sets all your regional settings based on your chosen language and gives you no way to adjust any of the settings: date formats, number formats, calendar system, nothing. You can manually edit the locale file but that's it. So far so Gnome, that's just their way. But I've tried poking around gnome.org and Googling to see what other calendar systems they support, but can't seem to find anything. Reading the code of Glib's GDate and Gtk's gtkcalendar.c would suggest however that they only support Gregorian as the system calendar! That can't be right, surely? Can anyone set me right?
So it looks a real mixed bag of supported systems with Windows having the lead, but it's something I'm determined we will lead in by KDE 4.6.
Next up is the Bahá'í calendar and possibly the Ethiopian calendar before the 4.4 feature freeze, then some bug fixing on the Jalali and Hebrew calendars and a new test suite for all the calendar systems. Then for 4.5 I hope to get around to the astronomical calculations required for lunar based calendars like the Chinese, Islamic religious, Indian religious, etc. I think I'll need to do some astronomy night classes before then :-)
If you do have a local calendar system that you use daily and would like supported, and it doesn't rely on astronomical calculations (new moon, sunset, etc) then drop me a line and I'll see what I can do before 4.4.