7089: minor optimization

svn: r23203
This commit is contained in:
Vassilii Khachaturov 2013-09-26 20:04:44 +00:00
parent 060cdf38a1
commit 89a7335057

View File

@ -1715,8 +1715,9 @@ def get_day_list(event_date, holiday_list, bday_anniv_list):
return day_list return day_list
def gregorian(date): def gregorian(date):
"""Convert given date to gregorian""" """Convert given date to gregorian. Doesn't modify the original object."""
date = gen.lib.Date(date) if date.get_calendar() != gen.lib.Date.CAL_GREGORIAN:
date.convert_calendar(gen.lib.Date.CAL_GREGORIAN) date = gen.lib.Date(date)
date.convert_calendar(gen.lib.Date.CAL_GREGORIAN)
return date return date