[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    Re: [Kde-pim] Say hello and a proposal...
From:       Adriaan de Groot <adridg () sci ! kun ! nl>
Date:       2002-02-25 13:23:11
[Download RAW message or body]

On Mon, 25 Feb 2002, Rik Hemsley wrote:
> How many calendar types are in use in the world ? If there are only 2
> or 3, perhaps it would be easiest to simply provide conversions, rather
> than using an abstract calendar and deriving from it ?

Thing is, eventually someone is going to want a Klingon calendar, or a
Mayan one, and I can think of five calendar schema's relevant right now:

- Gregorian
- Julian
- Hijri (moon-based)
- Jewish (moon-based)
- Chinese (?)

I vaguely recall the Mormons and Russian Orthodox churches having peculiar
calendars as well. And this list only includes northern-hemisphere
calendars.

This suggests that explicit coversions will cause a tangle later, and that
a single universal base class is a better choice (64-bit signed time_t
offset from 1970, anyone?). Then you can have:

HijriDate h(KDate::today());

and with a sensible interface (.isHoliday() seems too general to me) you
can use it for whatever you need.

Note that for the specific use of handling holidays in KOrganizer you can
"just" make a holiday plugin for which you don't need all this machinery.

> I'm no date guru :)

Show me *any* geek who knows what to do with a date, eh.

-- 
+------------------------------+--------------------------------------------+
+ Adriaan de Groot             + Project: FRESCoS                           +
+ adridg@cs.kun.nl             + Private: adridg@sci.kun.nl                 +
+ Kamer A6020 tel. 024 3652272 + http://www.cs.kun.nl/~adridg/frescos/      +

_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic