Skip to content

Commit

Permalink
Merge pull request #630 from CTPUG/penta-local-tz
Browse files Browse the repository at this point in the history
Explicitly convert schedule times to event local time
  • Loading branch information
drnlm committed Jun 3, 2022
2 parents 347c444 + d212abb commit 6b196cf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wafer/schedule/templates/wafer.schedule/penta_schedule.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
{% load i18n %}
{% load tz %}
<schedule>
<generator name="wafer" version="{{ wafer_version }}" />
<version>{{ schedule_version }}</version>
Expand All @@ -20,7 +21,7 @@
<acronym>{{ WAFER_CONFERENCE_ACRONYM }}</acronym>
</conference>
{% for page in schedule_pages %}
<day date="{{ page.block.start_time.date.isoformat }}" start="{{ page.block.start_time.isoformat }}" end="{{ page.block.end_time.isoformat }}" index="{{ forloop.counter }}">
<day date="{{ page.block.start_time|localtime|date:"Y-m-d" }}" start="{{ page.block.start_time|localtime|date:"c" }}" end="{{ page.block.end_time|localtime|date:"c" }}" index="{{ forloop.counter }}">
{% for venue in page.venues %}
<room name="{{ venue.name }}">
{% for row in page.rows %}
Expand All @@ -32,7 +33,7 @@
{# enough, but changes if the event is rescheduled. #}
{# Talks' guid will be stable across re-scheduling. #}
<event id="{{ items.item.pk }}" guid="{{ items.item.guid }}">
<date>{{ row.start_time.isoformat }}</date>
<date>{{ row.start_time|localtime|date:"c" }}</date>
<start>{{ row.start_time|time:"H:i" }}</start>
{% with dur=items.item.get_duration %}
<duration>{{ dur.hours|stringformat:"02d" }}:{{ dur.minutes|stringformat:"02d" }}</duration>
Expand Down

0 comments on commit 6b196cf

Please sign in to comment.