Calendars Around The World

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.

Indian National 20 October

Indian National earlist date

Indian National latest date

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:

  1. Chaitra  -  Cha
  2. Vaishākh  -  Vai
  3. Jyaishtha  -  Jya
  4. Āshādha  -  Āsh
  5. Shrāvana  -  Shr
  6. Bhādrapad  -  Bhā
  7. Āshwin  -  Āsw
  8. Kārtik  -  Kār
  9. Agrahayana  -  Agr
  10. Paush  -  Pau
  11. Māgh  -  Māg
  12. Phālgun  -  Phā

The weekday names I've used from somewhere are (starting from Monday):

  1. Somavãra  -  Som
  2. Mañgalvã  -  Mañ
  3. Budhavãra  -  Bud
  4. Guruvãra  -  Gur
  5. Sukravãra  -  Suk
  6. Sanivãra  -  San
  7. Raviãra  -  Rav


So our supported list of calendars is now:

  • Gregorian
  • Hebrew
  • Hijri
  • Indian National
  • Jalali
  • Julian

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:

  • Gregorian
  • Buddhist
  • Hebrew
  • Islamic
  • Islamic, Civil
  • Japanese

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:

  • Gregorian (6 different localised varieties)
  • Japanese Emperor Era
  • Taiwan calendar
  • Korean Tangun Era
  • Hijri (Arabic Lunar)
  • Thai
  • Hebrew (Lunar)
  • Um Al Qura (Arabic lunar) calendar

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 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.


Comment viewing options

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


I use only Gregorian calendar, but I really appreciate your work - one step closer to [calendar] world domination! ;) Btw, how did you solve 4 Oct - 14 Oct 1582?

In the 'pure' Gregorian and

In the 'pure' Gregorian and Julain calendars there are no missing days, thats the whole point.  In the hybrid Julian/Gregorian & QDate they just get skipped.  Fire up the plasma clock/calendar and navgate to Oct 1582 to see the 'missing' days.

Nice work!

Very nice indeed! I didn't know there were so many different calendars.

This is just the start,

This is just the start, there's at least 20 currently used ones we can choose to support, not to mention the historic ones we could also add.

Why transliterate ?

You mention transliteration, is this for the Latin script language versions only and is there a version in Hindi, Telugu or Kannada ?

Yes, this is just for the

Yes, this is just for the English translations, the separate l10n projects for Hindi, Telugu and Kannada will then translate those.

And the design...

I hope sometime the design of the calendar plasmoid will also be improved

I've been doing work on the

I've been doing work on the functionality of the plasma calendar, but I'm no good at the graphics side.  But it does need some love, there's some bad glitches that need fixing.

japanese calendar

I just wanted to state that the Japanese Calendar should be the most EASY to implement, since only the era and year is changed compared to the Gregorian calendar.
Anyway, good work !

Well, in theory yes, but the

Well, in theory yes, but the problem comes with using the Era in place of the Year in things like widgets.  It's easy to add a new method that returns the Era and Year in Era, but how would calendars display that, or even know to display it instead of the year?  And how would you enter it?  There's work required on our backend in the date formatting and reading to support it, but I have made some architectural changes in 4.4 as a step towards that.  One big problem we have is that while we would want to add new standard virtual API to KCalendarSystem class to support all systems that do this, we can't as this would break BIC.  I have to look into some alternatives from a coding point of view, and find out how existing Japanese software manages the display.

I am actually sad most of us

I am actually sad most of us have to resort to the Gregorian calendar (at least when we want to communicate with others about dates).
As an atheist (and actually for anyone not being a Christ) it's actually quite insulting to have a calendar system purely based on an alleged religious event.
Anyway, nice to see such sort of localization.

French Republican Calendar

Try French Republican Calendar, at least it is decimal. 

I've been thinking about

I've been thinking about supporting that, but find it hard to justify in kdelibs as no-one actually uses it.  In theory we can support a 10 day week, and it's a good test case to make sure code doesn't have any nasty assumptions around 7 day weeks.  Perhaps in a special plasma widget?

There's been a few attempts to come up with something better like the World Calendar and the International Fixed, but they all have their shortcomings, and to be honest the Gregorian is so deeply entrenched in both software and business changing would be all but impossible.

Thanks, this fixes a glaring hole

While not commonly used, one often comes across official dates for various things being given in the National calendar around here. It's usually a pain to convert, so thank you! :-)
I think it's accurate - after all, it's only a constant offset...
More interesting would be the religious calendar - that one's luni-solar, and the months don't follow fixed lengths or fixed offsets, and if you were to go the whole way with that, even the time system should technically change. If you want to attempt it, I'd be glad to help in any way I can, including code, and working out the right formulas. It would be useful to a whole lot of people to have a searchable Panchangam...
Again, thank you for giving this neglected corner some attention...

How can I get this

How can I get this calender?
I need a Chinese calender, and am on kubuntu karmic.
My calender here only supports normal gregorian calender, nothing more.
in preferences i can only set shortcut   . :-(

Hope you can help me...


You can use this project for the Islamic religious calendar

Thank you for thinking about other people's needs. Acutally, a lot of effort has been put into the "Hijra" project to make an Islamic calendar. The homepage of this project (in Arabic only I believe) is here:
and you can download it from here:
It is written in Python and it uses a special algorithm created by the author. He claims that this algorithm is closer to the lunar observation results than the EMACS algorithm. You can contact the author through his blog:
or by contacting me to make you two in touch. ( I am no programmer, just willin' to help :D )

Comment viewing options

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