|
|
|
|
@ -2,7 +2,8 @@ from django.db import models |
|
|
|
|
from tournaments.models import group_stage |
|
|
|
|
from . import Round, GroupStage, FederalMatchCategory |
|
|
|
|
from django.utils import timezone, formats |
|
|
|
|
from datetime import timedelta |
|
|
|
|
from datetime import datetime, timedelta |
|
|
|
|
|
|
|
|
|
import uuid |
|
|
|
|
|
|
|
|
|
from ..utils.extensions import format_seconds |
|
|
|
|
@ -80,8 +81,10 @@ class Match(models.Model): |
|
|
|
|
|
|
|
|
|
def formatted_start_date(self): |
|
|
|
|
if self.start_date: |
|
|
|
|
timezoned_datetime = timezone.localtime(self.start_date) |
|
|
|
|
return formats.date_format(timezoned_datetime, format='H:i') |
|
|
|
|
timezone = self.tournament().timezone() |
|
|
|
|
local_start = self.start_date.astimezone(timezone) |
|
|
|
|
# timezoned_datetime = timezone.localtime(self.start_date) |
|
|
|
|
return formats.date_format(local_start, format='H:i') |
|
|
|
|
# return formats.date_format(self.start_date, format='H:i') |
|
|
|
|
else: |
|
|
|
|
return '' |
|
|
|
|
|