7089: fix another similar code in StatisticsChart

svn: r23213
This commit is contained in:
Vassilii Khachaturov 2013-09-27 23:36:43 +00:00
parent 8365ea7090
commit a11fc4c228

View File

@ -43,7 +43,7 @@ from functools import partial
# Person and relation types
from gen.lib import Person, FamilyRelType, EventType, EventRoleType
from gen.lib.date import Date
from gen.lib.date import Date, gregorian
# gender and report type names
from gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle,
FONT_SANS_SERIF, FONT_SERIF,
@ -655,6 +655,7 @@ class Extract(object):
if birth:
birthdate = birth.get_date_object()
if birthdate.get_year_valid():
birthdate = gregorian(birthdate)
year = birthdate.get_year()
if not (year >= year_from and year <= year_to):
continue
@ -663,8 +664,10 @@ class Extract(object):
death = self.get_death(person)
if death:
deathdate = death.get_date_object()
if deathdate.get_year_valid() and deathdate.get_year() < year_from:
continue
if deathdate.get_year_valid():
deathdate = gregorian(deathdate)
if deathdate.get_year() < year_from:
continue
if not no_years:
# do not accept people who are not known to be in range
continue