Restored 0 years, but with word 'birth' or 'wedding'; removed extra words as they are too long for calendar

svn: r11741
This commit is contained in:
Doug Blank 2009-01-27 02:28:47 +00:00
parent b2b0573d36
commit 470ad5d62e

View File

@ -309,8 +309,6 @@ class Calendar(Report):
"""
This method runs through the data, and collects the relevant dates
and text.
age and years must be greater than zero, else why do it???
"""
people = self.database.get_person_handles(sort_handles=False)
self.progress.set_pass(_('Applying Filter...'), len(people))
@ -351,7 +349,7 @@ class Calendar(Report):
if father is not None:
father_lastname = father.get_primary_name().get_surname()
short_name = self.get_name(person, father_lastname)
if age > 0:
if age >= 0:
alive = probably_alive(person, self.database, make_date(self.year, month, day))
if ((self.alive and alive) or not self.alive):
comment = ""
@ -362,7 +360,10 @@ class Calendar(Report):
person)
if relation:
comment = " --- %s" % relation
self.add_day_item("%s, %d%s" % (short_name, age, comment), self.year, month, day)
if age == 0:
self.add_day_item("%s, birth%s" % (short_name, comment), self.year, month, day)
else:
self.add_day_item("%s, %d%s" % (short_name, age, comment), self.year, month, day)
if self.anniversaries:
family_list = person.get_family_handle_list()
for fhandle in family_list:
@ -399,12 +400,18 @@ class Calendar(Report):
month = event_obj.get_month()
day = event_obj.get_day()
years = self.year - year
if years > 0:
text = _("%(spouse)s and\n %(person)s, %(nyears)d year anniversary") % {
'spouse' : spouse_name,
'person' : short_name,
'nyears' : years,
}
if years >= 0:
if years == 0:
text = _("%(spouse)s and\n %(person)s, wedding") % {
'spouse' : spouse_name,
'person' : short_name,
}
else:
text = _("%(spouse)s and\n %(person)s, %(nyears)d") % {
'spouse' : spouse_name,
'person' : short_name,
'nyears' : years,
}
alive1 = probably_alive(person, self.database, make_date(self.year, month, day))
alive2 = probably_alive(spouse, self.database, make_date(self.year, month, day))
if ((self.alive and alive1 and alive2) or not self.alive):