diff --git a/src/DateHandler/_DateDisplay.py b/src/DateHandler/_DateDisplay.py index 12de801fc..3aa5bad2b 100644 --- a/src/DateHandler/_DateDisplay.py +++ b/src/DateHandler/_DateDisplay.py @@ -139,7 +139,12 @@ class DateDisplay(object): Formats the extra items (calendar, newyear) for a date. """ scal = self.calendar[cal] - snewyear = self.newyear[newyear] + if isinstance(newyear, int) and newyear <= len(self.newyear): + snewyear = self.newyear[newyear] + elif isinstance(newyear, (list, tuple)): + snewyear = "%s-%s" % (newyear[0], newyear[1]) + else: + snewyear = "Err" retval = "" for item in [scal, snewyear]: if item: