Commits

Nikolaj Sjujskij  committed c745a0a

Correct calculation of next month beginning for December

  • Participants
  • Parent commits 965f4a4

Comments (0)

Files changed (2)

     # calculate timestamp boundaries of the month
     clsd_after = calendar.timegm(
                       (basedate.year, basedate.month, 1) + (0,) * 3) * (10**6)
-    clsd_before = calendar.timegm(
+    if basedate.month == 12:
+        clsd_before = calendar.timegm(
+                      (basedate.year + 1, 1, 1) + (0,) * 3) * (10**6)
+    else:
+        clsd_before = calendar.timegm(
                       (basedate.year, basedate.month + 1, 1) + (0,) * 3) * (10**6)
 
     month_data, month_data_raw, opened, closed = ({}, ) * 4
     reporter = DEVS.get(tckt_dict['reporter'], tckt_dict['reporter'])
     return '{0} ({1})'.format(reporter, created_on.strftime("%d.%m.%Y"))
 
-
 if __name__ == "__main__":
     test = ({'key': 'val1', 'otherkey': 'otherval1'},
             {'key': 'val2', 'otherkey': 'otherval2'},