From: Don Allingham <dallingham@us...> - 2002-12-24 04:48:13
Possible Date/Calendar Enhancements
The following is a long term idea for a change in the way GRAMPS
handles dates. Date handling is one of the more complicated things
that GRAMPS has to deal with. These are proposed changes, and will not
appear in the near future (unless someone else wants to take on the task).
Currently, a Date in GRAMPS is a complex object. It needs handle a
date, a partial date, a range of dates, date approximations, and any
arbitrary text string. It also needs to allow for different calendar
representations, along with multiple language support.
The actual Date object itself consists of:
1) SingleDate representing a start date
2) SingleDate representing a stop date
3) range indicator
4) calendar marker
A SingleDate consists of a year, a month, a day, and a mode (exact,
about, before or after).
The current date format has several limitations:
1) The calendar code is integrated into the date, making it
difficult to add new formats
2) No date checking code exists. Date checking rules can be
complex, and are highly dependent on the calendar. The transition
from Julian and Gregorian calendars complicates this, since the
transition is dependent on region.
3) No way of representing calendar crossover dates like 12 Feb 1746/7
To improve date handling, dates need to be separated from the
calenadar. A Calendar object should exist that would be a property a
date. The calendar object should be reponsible for converting a string
to its internal representation, providing a string representation of
the date, and providing date validation checks. Calendars should be
treated as "plugins", allowing new calendars to be added on the fly.
Regional differences can be handled by different calendars. For
example, if Region1 and Region2 had two different switch points
between the Julian and Gregorian calenadars, the could be represented
by two different calendars, such as 'Julian (Region1)' or 'Julian
Any comments should be appreciated.