name weekday
This commit is contained in:
parent
654dd69f39
commit
ceb485ab1d
@ -66,6 +66,21 @@ class RUZ:
|
||||
]
|
||||
return formatted_data
|
||||
|
||||
def _name_weekday(self, weekday: int) -> str:
|
||||
if weekday == 0:
|
||||
return "Понедельник"
|
||||
if weekday == 1:
|
||||
return "Вторник"
|
||||
if weekday == 2:
|
||||
return "Среда"
|
||||
if weekday == 3:
|
||||
return "Четверг"
|
||||
if weekday == 4:
|
||||
return "Пятница"
|
||||
if weekday == 5:
|
||||
return "Суббота"
|
||||
return "Воскресенье"
|
||||
|
||||
def schedule_builder(self, lessons: list[dict]) -> str:
|
||||
ans = ""
|
||||
last_date = None
|
||||
@ -75,7 +90,7 @@ class RUZ:
|
||||
if last_date is not None:
|
||||
ans += "=======================\n\n"
|
||||
last_date = date
|
||||
ans += f"📅 *{date}*\n\n"
|
||||
ans += f"📅 *{date} ({self._name_weekday(lesson['begin'].weekday())})*\n\n"
|
||||
ans += f"📚 {lesson['discipline']}\n"
|
||||
ans += f"🏢 {lesson['building']}, {lesson['auditorium']}\n"
|
||||
ans += f"🕑 {lesson['begin'].strftime('%H:%M')} - {lesson['end'].strftime('%H:%M')}\n"
|
||||
|
Loading…
Reference in New Issue
Block a user