0.12.24 timezone in chat messages

This commit is contained in:
SDE
2024-02-09 20:33:04 +03:00
parent a3ba6bc783
commit 3971a8ee23
10 changed files with 56 additions and 17 deletions

View File

@@ -1,5 +1,19 @@
from django.template.loader import render_to_string
def get_user_timezone_Dict(user, request=None):
tz = None
if request:
tz = request.COOKIES.get("user_tz")
if not tz and user.is_authenticated:
tz = user.user_profile.get_timezone()
if not tz:
from django.conf import settings
tz = settings.TIME_ZONE
return {'user_tz': tz}
def get_dashboard_page_content_html(request):
from ChatServiceApp.funcs import get_unanswered_msgs_count_for_user