first
This commit is contained in:
25
keyboards/DateToBookingKeyboard.py
Normal file
25
keyboards/DateToBookingKeyboard.py
Normal file
@@ -0,0 +1,25 @@
|
||||
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
|
Reference in New Issue
Block a user