From kde-pim Mon Feb 25 13:23:11 2002 From: Adriaan de Groot Date: Mon, 25 Feb 2002 13:23:11 +0000 To: kde-pim Subject: Re: [Kde-pim] Say hello and a proposal... X-MARC-Message: https://marc.info/?l=kde-pim&m=101464346911208 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/