Added current time zone to render method in DateTimeColumn (#16323)

This commit is contained in:
Julio Oliveira at Encora 2024-06-12 10:23:49 -03:00 committed by GitHub
parent 917250deaa
commit 199febdcde

View File

@ -1,3 +1,4 @@
import zoneinfo
from dataclasses import dataclass
from typing import Optional
from urllib.parse import quote
@ -83,6 +84,8 @@ class DateTimeColumn(tables.Column):
def render(self, value):
if value:
current_tz = zoneinfo.ZoneInfo(settings.TIME_ZONE)
value = value.astimezone(current_tz)
return f"{value.date().isoformat()} {value.time().isoformat(timespec=self.timespec)}"
def value(self, value):