Commit fe8c163 1 parent b9e620f commit fe8c163 Copy full SHA for fe8c163
File tree 4 files changed +22
-6
lines changed
4 files changed +22
-6
lines changed Original file line number Diff line number Diff line change 1
1
{% load i18n %}
2
+ {% load editcourse %}
2
3
3
4
{% if error %}
4
5
< div class ="alert clearfix alert-danger " role ="alert "> {{ error }}</ div >
11
12
</ tr >
12
13
< tr >
13
14
< td > {% translate "BUILD_INITIATED_AT" %}</ td >
14
- < td > {{ request_time }}</ td >
15
+ < td > {{ request_time|make_timezone_aware }}</ td >
15
16
</ tr >
16
17
{% if not updated %}
17
18
< tr class ="warning ">
21
22
{% else %}
22
23
< tr >
23
24
< td > {% translate "BUILD_FINISHED" %}</ td >
24
- < td > {{ updated_time }}</ td >
25
+ < td > {{ updated_time|make_timezone_aware }}</ td >
25
26
</ tr >
26
27
{% endif %}
27
28
</ tbody >
Original file line number Diff line number Diff line change
1
+ from datetime import datetime
2
+
1
3
from django import template
2
4
from django .urls import reverse
5
+ from django .utils import timezone
3
6
4
7
from course .models import CourseInstance
5
8
@@ -56,3 +59,15 @@ def createurl(model_object, model_name):
56
59
model_name ,
57
60
parent_id = model_object .id ,
58
61
))
62
+
63
+
64
+ @register .filter
65
+ def make_timezone_aware (utc_time_str ):
66
+ try :
67
+ # Parse the Zulu date and time string into a naive datetime object
68
+ naive_datetime = datetime .strptime (utc_time_str , "%Y-%m-%dT%H:%M:%S.%fZ" )
69
+ # Convert it to a timezone-aware datetime object
70
+ aware_datetime = timezone .make_aware (naive_datetime , timezone .utc )
71
+ return aware_datetime
72
+ except ValueError :
73
+ return utc_time_str # Return the original string if parsing fails
Original file line number Diff line number Diff line change @@ -2601,11 +2601,11 @@ msgstr ""
2601
2601
2602
2602
#: edit_course/templates/edit_course/build_log.html
2603
2603
msgid "BUILD_INITIATED_BY"
2604
- msgstr "Build initated by"
2604
+ msgstr "Build initiated by"
2605
2605
2606
2606
#: edit_course/templates/edit_course/build_log.html
2607
2607
msgid "BUILD_INITIATED_AT"
2608
- msgstr "Build initated at"
2608
+ msgstr "Build initiated at"
2609
2609
2610
2610
#: edit_course/templates/edit_course/build_log.html
2611
2611
msgid "BUILD_FINISHED"
@@ -2678,7 +2678,7 @@ msgstr "Retrieve latest build log"
2678
2678
2679
2679
#: edit_course/templates/edit_course/edit_content.html
2680
2680
msgid "PREV_MODIFICATION_OF_COURSE_INSTANCE_TIME"
2681
- msgstr "Previous modification of this course instance took place at "
2681
+ msgstr "This course was previously built or the course settings were modified on "
2682
2682
2683
2683
#: edit_course/templates/edit_course/edit_content.html
2684
2684
msgid "EXERCISE_CATEGORIES"
Original file line number Diff line number Diff line change @@ -2695,7 +2695,7 @@ msgstr "Hae uusin käännösloki"
2695
2695
2696
2696
#: edit_course/templates/edit_course/edit_content.html
2697
2697
msgid "PREV_MODIFICATION_OF_COURSE_INSTANCE_TIME"
2698
- msgstr "Kurssia on viimeksi muokattu"
2698
+ msgstr "Tämä kurssi on viimeksi käännetty tai kurssin asetuksia on muokattu"
2699
2699
2700
2700
#: edit_course/templates/edit_course/edit_content.html
2701
2701
msgid "EXERCISE_CATEGORIES"
You can’t perform that action at this time.
0 commit comments