Skip to content

Commit

Permalink
add b3rd formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dtemkin1 committed Aug 7, 2023
1 parent b6e56fb commit c752c88
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion booklet.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
eastern = pytz.timezone("US/Eastern")


def event_dt_format(start_string, end_string):
def event_dt_format(start_string, end_string, group=""):
"""
Formats the time string that gets displayed on the booklet
"""
Expand All @@ -26,6 +26,10 @@ def event_dt_format(start_string, end_string):
else:
if dt.minute == 0:
time_strings.append(dt.strftime("%I %p").lstrip("0"))
elif dt.minute == 3 and group == "Burton Third":
time_strings.append(
f"{dt.strftime('%I:%M').lstrip('0')}rd {dt.strftime('%p')}"
)
else:
time_strings.append(dt.strftime("%I:%M %p").lstrip("0"))
out += " " + " - ".join(time_strings)
Expand Down
6 changes: 4 additions & 2 deletions templates/helpers.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{% macro event_box(event) %}
<div class="event {% for tag in event.tags %}tag-{{ tag }} {% endfor %}">
<div class="event {% for tag in event.tags %}tag-{{ tag }}{% endfor %}">
<span class="id">{{ event.id }}</span>
<span class="date">{{ format_date(event.start, event.end) }}</span>
<span class="date"
>{{ format_date(event.start, event.end, event.group) }}</span
>
&middot; {% for emoji in event.emoji %}{{ emoji }}{% endfor %}

<span class="title">{{ event.name }}</span>
Expand Down

0 comments on commit c752c88

Please sign in to comment.