浏览代码

Provide time_zone in event index page context

Jeremy Childers 4 月之前
父节点
当前提交
b8a18bad24
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      coderedcms/models/page_models.py

+ 5 - 0
coderedcms/models/page_models.py

@@ -1214,6 +1214,11 @@ class CoderedEventIndexPage(CoderedWebPage):
 
         return super().get_index_children()
 
+    def get_context(self, request, *args, **kwargs):
+        ctx = super().get_context(request, *args, **kwargs)
+        ctx["time_zone"] = settings.get("TIME_ZONE", "")
+        return ctx
+
     def get_calendar_events(
         self, start: Union[datetime, date], end: Union[datetime, date]
     ) -> List[Dict[str, str]]: