27 lines
640 B
Python
27 lines
640 B
Python
from app.keyboards.back import get_back_button
|
|
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
|
from datetime import datetime, timedelta
|
|
|
|
|
|
def get_dates_keyboard():
|
|
buttons = []
|
|
|
|
today = datetime.now()
|
|
|
|
for i in range(7):
|
|
day = today + timedelta(days=i)
|
|
|
|
buttons.append(
|
|
[
|
|
InlineKeyboardButton(
|
|
text=day.strftime("%d.%m"),
|
|
callback_data=f"date_{day.strftime('%d.%m.%Y')}"
|
|
)
|
|
]
|
|
)
|
|
|
|
buttons.append(get_back_button())
|
|
return InlineKeyboardMarkup(
|
|
inline_keyboard=buttons
|
|
)
|