Move date_utils to common/djangoapps/util
This commit is contained in:
@@ -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 _
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
%>
|
||||
|
||||
@@ -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
|
||||
<a href="#" class="edit-release-date action" data-date="" data-time="" data-locator="${section_locator}"><i class="icon-time"></i> <span class="sr">${_("Schedule")}</span></a>
|
||||
%else:
|
||||
<span class="published-status"><strong>${_("Release date:")}</strong>
|
||||
${date_utils.get_default_time_display(section.start)}</span>
|
||||
${get_default_time_display(section.start)}</span>
|
||||
<a href="#" class="edit-release-date action" data-date="${start_date_str}" data-time="${start_time_str}" data-locator="${section_locator}"><i class="icon-time"></i> <span class="sr">${_("Edit section release date")}</span></a>
|
||||
%endif
|
||||
</div>
|
||||
|
||||
@@ -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))
|
||||
@@ -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
|
||||
%>
|
||||
|
||||
@@ -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
|
||||
%>
|
||||
|
||||
|
||||
@@ -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
|
||||
%>
|
||||
<div class="folditbasic">
|
||||
<p><strong>${_("Due:")}</strong> ${get_default_time_display(due)}
|
||||
|
||||
Reference in New Issue
Block a user