From a160f6144f906a68c74f299e13f04b3200e67433 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Fri, 12 Oct 2012 15:16:44 -0400 Subject: [PATCH] Fix date display in unit page --- cms/djangoapps/contentstore/utils.py | 1 - cms/djangoapps/contentstore/views.py | 2 ++ cms/templates/unit.html | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cms/djangoapps/contentstore/utils.py b/cms/djangoapps/contentstore/utils.py index 9109efd292..582123b78f 100644 --- a/cms/djangoapps/contentstore/utils.py +++ b/cms/djangoapps/contentstore/utils.py @@ -77,5 +77,4 @@ def compute_unit_state(unit): def get_date_display(date): - print date, type(date) return date.strftime("%d %B, %Y at %I:%M %p") diff --git a/cms/djangoapps/contentstore/views.py b/cms/djangoapps/contentstore/views.py index 3e49e9f35a..ce476be481 100644 --- a/cms/djangoapps/contentstore/views.py +++ b/cms/djangoapps/contentstore/views.py @@ -10,6 +10,7 @@ import sys import time import tarfile import shutil +from datetime import datetime from collections import defaultdict from uuid import uuid4 from lxml import etree @@ -287,6 +288,7 @@ def edit_unit(request, location): 'draft_preview_link': preview_lms_link, 'published_preview_link': lms_link, 'subsection': containing_subsection, + 'release_date': get_date_display(datetime.fromtimestamp(time.mktime(containing_subsection.start))), 'section': containing_section, 'create_new_unit_template': Location('i4x', 'edx', 'templates', 'vertical', 'Empty'), 'unit_state': unit_state, diff --git a/cms/templates/unit.html b/cms/templates/unit.html index 28948b0ab6..0f4f999599 100644 --- a/cms/templates/unit.html +++ b/cms/templates/unit.html @@ -85,7 +85,7 @@

This is a draft of the published unit. To update the live version, you must replace it with this draft.

-

This unit is scheduled to be released to students on ${subsection.start} with the subsection "${subsection.display_name}"

+

This unit is scheduled to be released to students on ${release_date} with the subsection "${subsection.display_name}"

Save Draft