diff --git a/src/plugins/lib/holidays.xml b/src/plugins/lib/holidays.xml index ee62f403d..7d8508581 100644 --- a/src/plugins/lib/holidays.xml +++ b/src/plugins/lib/holidays.xml @@ -1,5 +1,7 @@ + + diff --git a/src/plugins/webreport/WebCal.py b/src/plugins/webreport/WebCal.py index 035064927..acef37926 100644 --- a/src/plugins/webreport/WebCal.py +++ b/src/plugins/webreport/WebCal.py @@ -908,12 +908,12 @@ class WebCalReport(Report): for cal_year in range(self.start_year, (self.end_year + 1)): # generate progress pass for year ???? - self.progress.set_pass(_('Creating year %d calendars') % cal_year, 1) + self.progress.set_pass(_('Creating year %d calendars') % cal_year, '') # initialize the holidays dict to fill: self.holidays = {} - # get the information, first from holidays: + # get the information, USA is equal to zero now if self.country != 0: self.__get_holidays(cal_year) @@ -1447,49 +1447,48 @@ def get_day_list(event_date, holiday_list, bday_anniv_list): # birthday/ anniversary on this day if bday_anniv_list > []: - for text, event, date in bday_anniv_list: + birth_anniversary = [(t, e, d) for t, e, d in bday_anniv_list if d.is_valid()] + for text, event, date in birth_anniversary: - # '...' signifies an incomplete date for an event. See add_day_item() txt_str = None - if date != '...': - # number of years married, ex: 10 - nyears = event_date.get_year() - date.get_year() + # number of years married, ex: 10 + nyears = event_date.get_year() - date.get_year() - # no negative years - # years have to be at least zero - if nyears > -1: + # no negative years + # years have to be at least zero + if nyears > -1: - # number of years for birthday, ex: 10 years - age_str = event_date - date - age_str.format(precision=1) + # number of years for birthday, ex: 10 years + age_str = event_date - date + age_str.format(precision=1) - # a birthday - if event == 'Birthday': + # a birthday + if event == 'Birthday': - if nyears == 0: - txt_str = _('%(person)s, birth') % { - 'person' : text} - else: - txt_str = _('%(person)s, %(age)s old') % { - 'person' : text, 'age' : age_str} + if nyears == 0: + txt_str = _('%(person)s, birth') % { + 'person' : text} + else: + txt_str = _('%(person)s, %(age)s old') % { + 'person' : text, 'age' : age_str} - # an anniversary - elif event == 'Anniversary': + # an anniversary + elif event == 'Anniversary': - if nyears == 0: - txt_str = _('%(couple)s, wedding') % { + if nyears == 0: + txt_str = _('%(couple)s, wedding') % { 'couple' : text} - else: - txt_str = (ngettext('%(couple)s, %(years)d' - ' year anniversary', - '%(couple)s, %(years)d' - ' year anniversary', nyears) - % {'couple' : text, 'years' : nyears}) - txt_str = '%s' % txt_str + else: + txt_str = (ngettext('%(couple)s, %(years)d' + ' year anniversary', + '%(couple)s, %(years)d' + ' year anniversary', nyears) + % {'couple' : text, 'years' : nyears}) + txt_str = '%s' % txt_str - if txt_str is not None: - day_list.append((nyears, date, txt_str, event)) + if txt_str is not None: + day_list.append((nyears, date, txt_str, event)) # sort them based on number of years # holidays will always be on top of day