Got time change hooked up but gained a spurious call to change on date

change.
This commit is contained in:
Don Mitchell
2012-11-27 15:15:28 -05:00
parent d165da3f81
commit 5331ae055f
4 changed files with 25 additions and 16 deletions

View File

@@ -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):

View File

@@ -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):
"""