2 次代码提交 b660e33d49 ... ea8e75e975

作者 SHA1 备注 提交日期
  VISHAL BHANUSHALI ea8e75e975 Merge branch 'master' of https://git.luminad.com/harshit.pathak/content_quality_tool 4 周之前
  VISHAL BHANUSHALI f443d753f3 changes for the view 4 周之前
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      title_creator_app/views.py

+ 4 - 2
title_creator_app/views.py

@@ -22,6 +22,7 @@ from rest_framework import status
 from rest_framework.views import APIView
 from django.utils import timezone
 import logging
+from zoneinfo import ZoneInfo
 logger = logging.getLogger(__name__)
 
 # To login
@@ -622,11 +623,12 @@ def get_title_creator_tasks_json(request):
             'filename': t.original_filename or "Unknown File",
             'status': t.status,
             'url': t.download_url,
-            'date': t.created_at.strftime("%d %b %Y, %I:%M %p"),
+            'date': t.created_at.astimezone(ZoneInfo("Asia/Kolkata")).strftime("%d %b %Y, %I:%M %p"),
             # Use a conditional (ternary) operator to handle the null case
-            'completed_at': t.completed_at.strftime("%d %b %Y, %I:%M %p") if t.completed_at else ""
+            'completed_at': t.completed_at.astimezone(ZoneInfo("Asia/Kolkata")).strftime("%d %b %Y, %I:%M %p") if t.completed_at else ""
             # 'completed_at': t.completed_at.strftime("%d %b %Y, %I:%M %p")
         })
+        print("data",data)
     return JsonResponse(data, safe=False)