diff --git a/geruecht/controller/userController.py b/geruecht/controller/userController.py index 1a07598..63ce79b 100644 --- a/geruecht/controller/userController.py +++ b/geruecht/controller/userController.py @@ -212,13 +212,16 @@ class UserController(metaclass=Singleton): 1 if oldMonth else now.month endDay = 1 debug.debug("calculate end day of month") + lockedYear = lockedYear if lockedMonth != 12 else (lockedYear + 1) + lockedMonth = (lockedMonth + 1) if lockedMonth != 12 else 1 for i in range(1, 8): - nextMonth = datetime(lockedYear, lockedMonth + 1, i) + nextMonth = datetime(lockedYear, lockedMonth, i) if nextMonth.weekday() == 2: endDay = i break - monthLockedEndDate = datetime(lockedYear, lockedMonth + 1, endDay) + monthLockedEndDate = datetime( + lockedYear, lockedMonth, endDay) - timedelta(1) debug.debug("get lock day from database") retVal = db.getLockedDay(date.date()) if not retVal: