Less indentation

main
Bob Mottram 2024-07-16 10:55:34 +01:00
parent 44bff188c2
commit 0a34a1d00f
1 changed files with 28 additions and 26 deletions

View File

@ -368,32 +368,34 @@ def html_calendar(person_cache: {}, translate: {},
if '?' in actor:
first = True
for part in actor.split('?'):
if not first:
if '=' in part:
if part.split('=')[0] == 'year':
num_str = part.split('=')[1]
if len(num_str) <= 5:
if num_str.isdigit():
year = int(num_str)
elif part.split('=')[0] == 'month':
num_str = part.split('=')[1]
if len(num_str) <= 3:
if num_str.isdigit():
month_number = int(num_str)
elif part.split('=')[0] == 'day':
num_str = part.split('=')[1]
if len(num_str) <= 3:
if num_str.isdigit():
day_number = int(num_str)
elif part.split('=')[0] == 'ical':
bool_str = part.split('=')[1]
if bool_str.lower().startswith('t'):
icalendar = True
elif part.split('=')[0] == 'onlyShowReminders':
bool_str = part.split('=')[1]
if bool_str.lower().startswith('t'):
only_show_reminders = True
first = False
if first:
first = False
continue
if '=' not in part:
continue
if part.split('=')[0] == 'year':
num_str = part.split('=')[1]
if len(num_str) <= 5:
if num_str.isdigit():
year = int(num_str)
elif part.split('=')[0] == 'month':
num_str = part.split('=')[1]
if len(num_str) <= 3:
if num_str.isdigit():
month_number = int(num_str)
elif part.split('=')[0] == 'day':
num_str = part.split('=')[1]
if len(num_str) <= 3:
if num_str.isdigit():
day_number = int(num_str)
elif part.split('=')[0] == 'ical':
bool_str = part.split('=')[1]
if bool_str.lower().startswith('t'):
icalendar = True
elif part.split('=')[0] == 'onlyShowReminders':
bool_str = part.split('=')[1]
if bool_str.lower().startswith('t'):
only_show_reminders = True
actor = actor.split('?')[0]
curr_date = datetime.now()