Skip to content
This repository was archived by the owner on Jun 30, 2024. It is now read-only.

Commit aad42e5

Browse files
committed
Convert the timezones on the who's online report.
1 parent fabf7e0 commit aad42e5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

controllers/dashboard.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,10 @@ def active():
852852
div_id = row[2]
853853
components = div_id.rsplit("/", 2)
854854
div_id = "/".join(components[1:])
855-
newres.append(dict(timestamp=row[0], sid=row[1], div_id=div_id))
855+
time_local = row[0] - datetime.timedelta(
856+
hours=float(session.timezoneoffset) if "timezoneoffset" in session else 0
857+
)
858+
newres.append(dict(timestamp=time_local, sid=row[1], div_id=div_id))
856859
print(newres)
857860
logger.error(newres)
858861
return dict(activestudents=newres, course=course)

0 commit comments

Comments
 (0)