diff --git a/cms/djangoapps/contentstore/views/assets.py b/cms/djangoapps/contentstore/views/assets.py index cd59b811d7..dd96cd213a 100644 --- a/cms/djangoapps/contentstore/views/assets.py +++ b/cms/djangoapps/contentstore/views/assets.py @@ -16,13 +16,13 @@ from xmodule.contentstore.django import contentstore from xmodule.modulestore.django import modulestore from xmodule.modulestore import Location from xmodule.contentstore.content import StaticContent -from xmodule.util.date_utils import get_default_time_display from xmodule.modulestore import InvalidLocationError from xmodule.exceptions import NotFoundError from django.core.exceptions import PermissionDenied from xmodule.modulestore.django import loc_mapper from xmodule.modulestore.locator import BlockUsageLocator +from util.date_utils import get_default_time_display from util.json_request import JsonResponse from django.http import HttpResponseNotFound from django.utils.translation import ugettext as _ diff --git a/cms/djangoapps/contentstore/views/component.py b/cms/djangoapps/contentstore/views/component.py index 8c1bcb7a9d..7b8eb5b252 100644 --- a/cms/djangoapps/contentstore/views/component.py +++ b/cms/djangoapps/contentstore/views/component.py @@ -10,8 +10,8 @@ from django.conf import settings from xmodule.modulestore.exceptions import ItemNotFoundError from edxmako.shortcuts import render_to_response +from util.date_utils import get_default_time_display from xmodule.modulestore.django import modulestore -from xmodule.util.date_utils import get_default_time_display from xmodule.modulestore.django import loc_mapper from xmodule.modulestore.locator import BlockUsageLocator diff --git a/cms/templates/edit_subsection.html b/cms/templates/edit_subsection.html index be4c042bc7..4103c0752b 100644 --- a/cms/templates/edit_subsection.html +++ b/cms/templates/edit_subsection.html @@ -1,7 +1,7 @@ <%inherit file="base.html" /> <%! import logging - from xmodule.util.date_utils import get_default_time_display, almost_same_datetime + from util.date_utils import get_default_time_display, almost_same_datetime from django.utils.translation import ugettext as _ from django.core.urlresolvers import reverse %> diff --git a/cms/templates/overview.html b/cms/templates/overview.html index e7aa8da9ad..dc74f5c799 100644 --- a/cms/templates/overview.html +++ b/cms/templates/overview.html @@ -1,7 +1,7 @@ <%inherit file="base.html" /> <%! import logging - from xmodule.util import date_utils + from util.date_utils import get_default_time_display from django.utils.translation import ugettext as _ from django.core.urlresolvers import reverse from xmodule.modulestore.django import loc_mapper @@ -188,7 +188,7 @@ require(["domReady!", "jquery", "js/models/location", "js/models/section", "js/v ${_("Schedule")} %else: ${_("Release date:")} - ${date_utils.get_default_time_display(section.start)} + ${get_default_time_display(section.start)} ${_("Edit section release date")} %endif diff --git a/common/lib/xmodule/xmodule/util/date_utils.py b/common/djangoapps/util/date_utils.py similarity index 100% rename from common/lib/xmodule/xmodule/util/date_utils.py rename to common/djangoapps/util/date_utils.py diff --git a/common/lib/xmodule/xmodule/tests/test_date_utils.py b/common/djangoapps/util/tests/test_date_utils.py similarity index 96% rename from common/lib/xmodule/xmodule/tests/test_date_utils.py rename to common/djangoapps/util/tests/test_date_utils.py index ae6fd7f109..22776d9569 100644 --- a/common/lib/xmodule/xmodule/tests/test_date_utils.py +++ b/common/djangoapps/util/tests/test_date_utils.py @@ -1,10 +1,12 @@ -"""Tests for xmodule.util.date_utils""" +"""Tests for util.date_utils""" + +from datetime import datetime, timedelta, tzinfo from nose.tools import assert_equals, assert_false # pylint: disable=E0611 -from xmodule.util.date_utils import get_default_time_display, get_time_display, almost_same_datetime -from datetime import datetime, timedelta, tzinfo from pytz import UTC, timezone +from util.date_utils import get_default_time_display, get_time_display, almost_same_datetime + def test_get_default_time_display(): assert_equals("", get_default_time_display(None)) diff --git a/lms/templates/courseware/accordion.html b/lms/templates/courseware/accordion.html index d857fc3ba0..b261e261c6 100644 --- a/lms/templates/courseware/accordion.html +++ b/lms/templates/courseware/accordion.html @@ -1,6 +1,6 @@ <%! from django.core.urlresolvers import reverse - from xmodule.util.date_utils import get_time_display + from util.date_utils import get_time_display from django.utils.translation import ugettext as _ from django.conf import settings %> diff --git a/lms/templates/courseware/progress.html b/lms/templates/courseware/progress.html index 7eeea8da59..02cec1f373 100644 --- a/lms/templates/courseware/progress.html +++ b/lms/templates/courseware/progress.html @@ -17,7 +17,7 @@ %> <%! -from xmodule.util.date_utils import get_time_display +from util.date_utils import get_time_display from django.conf import settings %> diff --git a/lms/templates/folditbasic.html b/lms/templates/folditbasic.html index e05ceb1452..e5073751bb 100644 --- a/lms/templates/folditbasic.html +++ b/lms/templates/folditbasic.html @@ -1,7 +1,7 @@ <%! from django.utils.translation import ugettext as _ %> <%! -from xmodule.util.date_utils import get_default_time_display +from util.date_utils import get_default_time_display %>
${_("Due:")} ${get_default_time_display(due)}