From e5859d3d95df3d924ea89aa1649be8d7023eee69 Mon Sep 17 00:00:00 2001 From: Nataly Kirillova Date: Wed, 11 Oct 2023 13:07:05 +0200 Subject: [PATCH] today date bug fixed --- handlers/personal_actions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handlers/personal_actions.py b/handlers/personal_actions.py index a3a6142..9e59eb3 100644 --- a/handlers/personal_actions.py +++ b/handlers/personal_actions.py @@ -14,7 +14,6 @@ MONTHLY_EXPENCES = 600 PERIOD_START = [2023, 9, 25] PERIOD_END = [PERIOD_START[0], PERIOD_START[1]+1, PERIOD_START[2]-1] -TODAY_DATE = datetime.datetime.today() def get_start_kb() -> ReplyKeyboardMarkup: @@ -197,7 +196,8 @@ async def load_category(call: types.CallbackQuery, state: FSMContext): def prepare_report_message(): left = round(MONTHLY_EXPENCES - BotDB.get_records(), 2) - days_left = (datetime.datetime(*PERIOD_END) - TODAY_DATE).days + 1 + days_left = ( + datetime.datetime(*PERIOD_END) - datetime.datetime.today()).days + 1 daily_av = round(left / days_left, 2) return (f'Осталось:\n{left} € на {days_left} дней\n' + f'{daily_av} € - лимит трат на день')