Comments (5)
Hello! Thank you for the message. I could not repeat this. Can you please provide an example of code where min_date
does not work properly?
For now, I can only say that you might have not specified min_date
when creating a calendar object inside a query handler.
You need to pass all the arguments every time you create a calendar.
@bot.message_handler(commands=['start'])
def start(m):
calendar, step = DetailedTelegramCalendar(min_date=date.today()).build()
bot.send_message(m.chat.id,
f"Select {LSTEP[step]}",
reply_markup=calendar)
@bot.callback_query_handler(func=DetailedTelegramCalendar.func())
def cal(c):
result, key, step = DetailedTelegramCalendar(min_date=date.today()).process(c.data)
if not result and key:
bot.edit_message_text(f"Select {LSTEP[step]}",
c.message.chat.id,
c.message.message_id,
reply_markup=key)
elif result:
bot.edit_message_text(f"You selected {result}",
c.message.chat.id,
c.message.message_id)
from python-telegram-bot-calendar.
Thanks, indeed I haven't specified min_date in the query handler.
Is there a way to setup calendar with dynamic min and max dates in a DRY way?
from python-telegram-bot-calendar.
Посмотрел ваш профиль) Привет из Центра геоинформационных систем УИ 👋
from python-telegram-bot-calendar.
Is there a way to setup calendar with dynamic min and max dates in a DRY way?
The module does not support it. But the easiest way that comes to my mind is to create a function that will create a calendar object, so you will need to call the function twice.
If you have any ideas how I can improve it I will be happy to see them:)
Посмотрел ваш профиль) Привет из Центра геоинформационных систем УИ 👋
Привет👋 Приятно видеть людей из УИ)
from python-telegram-bot-calendar.
Feel free to reopen this issue
from python-telegram-bot-calendar.
Related Issues (10)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-telegram-bot-calendar.