From 89a7335057353ec3003645c2df4b450d6c8aea0a Mon Sep 17 00:00:00 2001 From: Vassilii Khachaturov Date: Thu, 26 Sep 2013 20:04:44 +0000 Subject: [PATCH] 7089: minor optimization svn: r23203 --- src/plugins/webreport/WebCal.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/webreport/WebCal.py b/src/plugins/webreport/WebCal.py index d0e7abae8..ff6828b95 100644 --- a/src/plugins/webreport/WebCal.py +++ b/src/plugins/webreport/WebCal.py @@ -1715,8 +1715,9 @@ def get_day_list(event_date, holiday_list, bday_anniv_list): return day_list def gregorian(date): - """Convert given date to gregorian""" - date = gen.lib.Date(date) - date.convert_calendar(gen.lib.Date.CAL_GREGORIAN) + """Convert given date to gregorian. Doesn't modify the original object.""" + if date.get_calendar() != gen.lib.Date.CAL_GREGORIAN: + date = gen.lib.Date(date) + date.convert_calendar(gen.lib.Date.CAL_GREGORIAN) return date