26 lines
800 B
Python
26 lines
800 B
Python
|
from datetime import datetime, timedelta
|
||
|
|
||
|
from bot.Keyboard import Keyboard
|
||
|
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
|
||
|
|
||
|
|
||
|
class DateToBookingKeyboard(Keyboard):
|
||
|
|
||
|
def get_keyboard(self):
|
||
|
current_day = datetime.now()
|
||
|
keyboard = []
|
||
|
for i in range(1, 8):
|
||
|
keyboard.append(
|
||
|
[
|
||
|
InlineKeyboardButton(current_day.strftime("%d.%m.%Y"),
|
||
|
callback_data="set_date={date}".format(date=current_day.strftime("%d.%m.%Y")))
|
||
|
]
|
||
|
)
|
||
|
current_day = current_day + timedelta(days=1)
|
||
|
keyboard.append(
|
||
|
[
|
||
|
InlineKeyboardButton("Назад", callback_data="set_date=back")
|
||
|
]
|
||
|
)
|
||
|
return keyboard
|