From: Peter L. <pet...@te...> - 2008-02-18 12:07:31
|
Den Monday 18 February 2008 09.43.43 skrev Benny Malengier: > 2008/2/18, Douglas S. Blank <db...@cs...>: > > Grampsters, > > > > I've been working on some date math for this bug/feature: > > > > http://bugs.gramps-project.org/view.php?id=1649 > > > > This is useful for a few functions. One is for a date calculator inside > > the Python interpreter in the gramplets: > > > > > > http://www.gramps-project.org/wiki/index.php?title=GEPS_004:_My_GRAMPS_an > >d_Gadgets#Python_Gramplet > > > > so, for example, you can see how long someone lived: > > > Date(1955, 9, 3) - Date(1922, 5, 7) > > > > (33, 3, 27) # (33 years, 3 months, and 27 days) > > > > Peter asks the question: > > > > """Did you take into account the changeover from the Julian calender to > > the Gregorian? This took place for most of the world by a decision by the > > Pope 1583. However, Sweden waited until 1753 for this, so February, 18 > > 1753 was followed by March, 1 1753.""" > > > > I know the relevant code is in src/gen/lib/calendar.py but I don't see > > anything there that seems to deal with this specifically. Is there code > > in GRAMPS that handles this gap? If not, do we want to? As Peter notes, > > it would have to be handled by location and time. > > Gregorian and Julian are calanders, you could use both today if you want. > When a specific country switched from one to the other is not the issue. > The user has to give up the correct calander in GRAMPS when entering a > date, GRAMPS must not guess what date is entered based on the country you > are in. > Yes, I see what you mean. My question was if the Date() tool i Gramplets should know where and when this switch took place. So that your Date() caluclation does not answer a with a non existing date. /Peter |