time zone magic around virtualevent
This commit is contained in:
@@ -148,6 +148,7 @@ import matplotlib.pyplot as plt
|
||||
from rowers.emails import send_template_email
|
||||
|
||||
from pytz import timezone as tz,utc
|
||||
from timezonefinder import TimezoneFinder
|
||||
import dateutil
|
||||
import mpld3
|
||||
from mpld3 import plugins
|
||||
@@ -13324,7 +13325,28 @@ def virtualevent_create_view(request):
|
||||
contact_phone = cd['contact_phone']
|
||||
contact_email = cd['contact_email']
|
||||
|
||||
# correct times
|
||||
|
||||
geocourse = GeoCourse.objects.get(id= course.id)
|
||||
timezone_str = courses.get_course_timezone(geocourse)
|
||||
|
||||
startdatetime = datetime.datetime.combine(startdate,start_time)
|
||||
enddatetime = datetime.datetime.combine(enddate,end_time)
|
||||
|
||||
startdatetime = pytz.timezone(timezone_str).localize(
|
||||
startdatetime
|
||||
)
|
||||
enddatetime = pytz.timezone(timezone_str).localize(
|
||||
enddatetime
|
||||
)
|
||||
evaluation_closure = pytz.timezone(timezone_str).localize(
|
||||
evaluation_closure.replace(tzinfo=None)
|
||||
)
|
||||
registration_closure = pytz.timezone(timezone_str).localize(
|
||||
registration_closure.replace(tzinfo=None)
|
||||
)
|
||||
|
||||
|
||||
|
||||
vs = VirtualRace(
|
||||
name=name,
|
||||
|
||||
Reference in New Issue
Block a user