Skip to content

Commit

Permalink
today date bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Gatitka committed Oct 11, 2023
1 parent 5643a76 commit e5859d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions handlers/personal_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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} € - лимит трат на день')
Expand Down

0 comments on commit e5859d3

Please sign in to comment.