7089: webcal mistreats non-gregorian event dates

svn: r23202
This commit is contained in:
Vassilii Khachaturov 2013-09-26 19:50:16 +00:00
parent 7e064c9494
commit 060cdf38a1

View File

@ -559,7 +559,7 @@ class WebCalReport(Report):
elif url_fname == 'fullyearlinked':
myTitle = _('Full year at a Glance')
else:
myTitle = _(url_fname)
myTitle = _(url_fname)
hyper = Html("a", nav_text, href = url, name = url_fname, title = myTitle)
if check_cs:
@ -1084,6 +1084,7 @@ class WebCalReport(Report):
# determine birthday information???
if (self.birthday and birth_date is not gen.lib.Date.EMPTY and birth_date.is_valid()):
birth_date = gregorian(birth_date)
year = birth_date.get_year() or this_year
month = birth_date.get_month()
@ -1147,6 +1148,7 @@ class WebCalReport(Report):
if marriage_event:
event_date = marriage_event.get_date_object()
if event_date is not gen.lib.Date.EMPTY and event_date.is_valid():
event_date = gregorian(event_date)
year = event_date.get_year()
month = event_date.get_month()
day = event_date.get_day()
@ -1711,3 +1713,10 @@ def get_day_list(event_date, holiday_list, bday_anniv_list):
# return to its caller calendar_build()
return day_list
def gregorian(date):
"""Convert given date to gregorian"""
date = gen.lib.Date(date)
date.convert_calendar(gen.lib.Date.CAL_GREGORIAN)
return date