fix wrong comment writing and wrong week detection
This commit is contained in:
parent
be7197a999
commit
48a106ce69
|
@ -153,7 +153,7 @@ def get_human_readable_date(start_datetime, end_datetime,
|
||||||
if ((current_day + 2) == int(start_datetime.strftime("%u"))) or \
|
if ((current_day + 2) == int(start_datetime.strftime("%u"))) or \
|
||||||
((current_day == 6) and (start_datetime.strftime("%u") == "1")):
|
((current_day == 6) and (start_datetime.strftime("%u") == "1")):
|
||||||
human_readable_date += "завтра "
|
human_readable_date += "завтра "
|
||||||
elif current_week != int(start_datetime.strftime("%W")) % 2:
|
elif current_week != (int(start_datetime.strftime("%W")) + 1) % 2:
|
||||||
human_readable_date += f"{WEEKDAYS_GENITIVE_NEXT[int(start_datetime.strftime('%u')) - 1]} "
|
human_readable_date += f"{WEEKDAYS_GENITIVE_NEXT[int(start_datetime.strftime('%u')) - 1]} "
|
||||||
elif current_day != (int(start_datetime.strftime("%u")) - 1):
|
elif current_day != (int(start_datetime.strftime("%u")) - 1):
|
||||||
human_readable_date += f"{WEEKDAYS_GENITIVE_THIS[int(start_datetime.strftime('%u')) - 1]} "
|
human_readable_date += f"{WEEKDAYS_GENITIVE_THIS[int(start_datetime.strftime('%u')) - 1]} "
|
||||||
|
@ -256,14 +256,14 @@ def generate_lesson_description(lesson, start_datetime, end_datetime, current_da
|
||||||
active_template = active_template.replace("%NAME_PREFIX%", custom_name_prefix)
|
active_template = active_template.replace("%NAME_PREFIX%", custom_name_prefix)
|
||||||
active_template = active_template.replace("%COLOR_CODE%", get_color_code(l['type']))
|
active_template = active_template.replace("%COLOR_CODE%", get_color_code(l['type']))
|
||||||
|
|
||||||
if ('nolink' not in lesson) or (not lesson['nolink']):
|
if ('nolink' not in l) or (not l['nolink']):
|
||||||
active_template = active_template.replace("%LINK%", l['link'])
|
active_template = active_template.replace("%LINK%", l['link'])
|
||||||
else:
|
else:
|
||||||
active_template = active_template.replace("%LINK%", "#")
|
active_template = active_template.replace("%LINK%", "#")
|
||||||
|
|
||||||
if 'comment' in lesson:
|
if 'comment' in l:
|
||||||
active_template += load_template(template, "comment")
|
active_template += load_template(template, "comment")
|
||||||
active_template = active_template.replace("%COMMENT%", lesson["comment"])
|
active_template = active_template.replace("%COMMENT%", l["comment"])
|
||||||
|
|
||||||
if "full" in overrides and overrides["full"]:
|
if "full" in overrides and overrides["full"]:
|
||||||
active_template += "\n"
|
active_template += "\n"
|
||||||
|
|
Loading…
Reference in New Issue