Non Gregorian calendar support in KDE

Hans Petter Bieker bieker at itk.ntnu.no
Wed Jan 1 15:37:04 GMT 2003


Hi,

Caros Moro and I have been working on support for non Gregorian calendars
in KDE. We currently have a working prototype, and we would like to have
feedback on our implementation. The calendar support is implemented by the
abstract KCalendarSystem class and it's derived classes. A factory class
(KCalendarSystemFactory) is also provided, and the support is integrated
into KLocale.

We have also changed KLocale::readDate(), KLocale::formatDate(),
KDatePicker, KDateWidget, and KDateTable to use this new class.
KLocale::monthName(), KLocale::monthNamePossessive(), and
KLocale::weekDayName() are not changed it keep it compatible.

In most cases this will be just fine, but there are some problems. A few
applications use QDate directly to extend KDE widgets. In such
applications, this may result applications where some dates are
displayed using the Gregorian calendar where some are not.

We currently support the Gregorian (Western) and the Hijri (Islamic)
clendars. A Jewish calendar is also under development.

You may find the implementation in the calendar_support branch. Check out
the files below:
* kdelibs/kdecore/klocale.h
* kdelibs/kdecore/klocale.cpp
* kdelibs/kdecore/kcalendarsystem.h
* kdelibs/kdecore/kcalendarsystem.cpp
* kdelibs/kdecore/kcalendarsystemhijri.h
* kdelibs/kdecore/kcalendarsystemhijri.cpp
* kdelibs/kdecore/kcalendarsystemgregorian.h
* kdelibs/kdecore/kcalendarsystemgregorian.cpp
* kdelibs/kdecore/kcalendarfactory.h
* kdelibs/kdecore/kcalendarfactory.cpp
* kdelibs/kdeui/kdatepicker.cpp
* kdelibs/kdeui/kdatetbl.cpp

To test the Hijri (Islamic) calendar you should also add the following to
kdeglobals:
[Locale]
CalendarSystem=hijri

Norwegian University of Science and Technology, Engineering Cybernetics
          bieker at itk.ntnu.no / bieker at kde.org / +47 97651633
                Dagaliveien 25 A  |  Elgesetergate 23 B
                N-0776 Oslo       |  N-7030 Trondheim





More information about the kde-core-devel mailing list