Got time change hooked up but gained a spurious call to change on date
change.
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.course_module import CourseDescriptor
|
||||
from xmodule.modulestore import Location
|
||||
from xmodule.modulestore.exceptions import ItemNotFoundError
|
||||
import json
|
||||
from json.encoder import JSONEncoder
|
||||
import time
|
||||
from util.converters import time_to_date, jsdate_to_time
|
||||
from util.converters import jsdate_to_time, time_to_date
|
||||
|
||||
class CourseDetails:
|
||||
def __init__(self, location):
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import time, datetime
|
||||
import re
|
||||
import calendar
|
||||
|
||||
def time_to_date(time_obj):
|
||||
"""
|
||||
Convert a time.time_struct to a true universal time (can pass to js Date constructor)
|
||||
"""
|
||||
return time.mktime(time_obj) * 1000
|
||||
return calendar.timegm(time_obj) * 1000
|
||||
|
||||
def jsdate_to_time(field):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user