Update simple_calendar.py
added come functionality to simple calendar I'm developer from Russia and I decided that it will be great to add some local functionality to other people from other countries that helps to faster localize it's apps. Added button "Cancel" for canceling operation. And added button "Today" to return in current month if user decided to return to today's calendar view. Added visual selection of current day in calendar

Example of cancel button
# example_bot.py
@dp.callback_query_handler(cancel_callback.filter())
async def cancel_action(callback_query: CallbackQuery, callback_data: dict):
await callback_query.message.edit_text('You canceled action')
await callback_query.answer()
Hope it will helps to other developers
OOOOPS
I missed one important thing
Aiogram raises Error MessageNotModified if user accidentally selected "Today" in today's calendar view
I don't know how to modify my merge request, I will write here:
in simple_calendar.py you should insert this:
from contextlib import suppress
from aiogram.utils.exceptions import MessageNotModified
...
class SimpleCalendar:
...
async def process_selection(self, query: CallbackQuery, data: CallbackData) -> tuple:
...
if data['act'] == "CURR-MONTH":
next_date = datetime.now()
with suppress(MessageNotModified):
await query.answer()
await query.message.edit_reply_markup(
await self.start_calendar((next_date.year),(next_date.month))
)
How can I hide the dates that have passed?
package updated for aiogram 3, also has a built in localisation ability