From af3dcfb36008d25f7a85ed8e9df150ece0f68bd8 Mon Sep 17 00:00:00 2001
From: Jonathan Weth <git@jonathanweth.de>
Date: Sat, 15 Aug 2020 15:34:15 +0200
Subject: [PATCH] Use weekday_to_date instead of period_to_date everywhere

---
 .../alsijil/templates/alsijil/class_register/person.html     | 5 ++---
 .../apps/alsijil/templates/alsijil/print/full_register.html  | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/aleksis/apps/alsijil/templates/alsijil/class_register/person.html b/aleksis/apps/alsijil/templates/alsijil/class_register/person.html
index ef2917776..bc715d679 100644
--- a/aleksis/apps/alsijil/templates/alsijil/class_register/person.html
+++ b/aleksis/apps/alsijil/templates/alsijil/class_register/person.html
@@ -20,7 +20,7 @@
 
     <ul class="collection">
       {% for note in unexcused_absences %}
-        {% period_to_date note.week note.lesson_period.period as note_date %}
+        {% weekday_to_date note.calendar_week note.lesson_period.period.weekday as note_date %}
         <li class="collection-item">
           <form action="" method="post" class="right" style="margin-top: -7px;">
             {% csrf_token %}
@@ -63,8 +63,7 @@
                   <strong>{% blocktrans with week=note.week %}Week {{ week }}{% endblocktrans %}</strong>
                 </li>
               {% endifchanged %}
-
-              {% period_to_date note.week note.lesson_period.period as note_date %}
+              {% weekday_to_date note.calendar_week note.lesson_period.period.weekday as note_date %}
               {% ifchanged note_date %}
                 <li class="collection-item">
                   <form action="" method="post" class="right" style="margin-top: -7px;">
diff --git a/aleksis/apps/alsijil/templates/alsijil/print/full_register.html b/aleksis/apps/alsijil/templates/alsijil/print/full_register.html
index 373ae6a88..03b75de7b 100644
--- a/aleksis/apps/alsijil/templates/alsijil/print/full_register.html
+++ b/aleksis/apps/alsijil/templates/alsijil/print/full_register.html
@@ -319,7 +319,7 @@
       {% for note in person.personal_notes.all %}
         {% if note.lesson_period in lesson_periods %}
           {% if note.absent or note.late or note.remarks or note.extra_marks.all %}
-            {% period_to_date note.week note.lesson_period.period as note_date %}
+              {% weekday_to_date note.calendar_week note.lesson_period.period.weekday as note_date %}
             <tr>
               <td>{{ note_date }}</td>
               <td>{{ note.lesson_period.period.period }}</td>
-- 
GitLab