parent
3dad2e8552
commit
974d4bae18
@ -218,6 +218,17 @@ class BasePage:
|
||||
"""
|
||||
pass
|
||||
|
||||
def sort_by_event_date(self, handle):
|
||||
""" Used to sort events by date. """
|
||||
event = self.r_db.get_event_from_handle(handle.ref)
|
||||
date = event.get_date_object()
|
||||
if date.get_year() > 0:
|
||||
return date
|
||||
else:
|
||||
# if we have no date, we'll put the event at the
|
||||
# end of the list
|
||||
return Date(9999, 1, 1)
|
||||
|
||||
def sort_on_name_and_grampsid(self, handle):
|
||||
""" Used to sort on name and gramps ID. """
|
||||
person = self.r_db.get_person_from_handle(handle)
|
||||
|
@ -1814,7 +1814,7 @@ class PersonPages(BasePage):
|
||||
tbody = Html("tbody")
|
||||
table += tbody
|
||||
|
||||
for evt_ref in event_ref_list:
|
||||
for evt_ref in sorted(event_ref_list, key=self.sort_by_event_date):
|
||||
event = self.r_db.get_event_from_handle(evt_ref.ref)
|
||||
if event:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user