Show GMT time, 24-hour.

This commit is contained in:
cahrens
2013-04-04 16:56:10 -04:00
parent 9075e84430
commit 49e0753ef5
4 changed files with 5 additions and 5 deletions

View File

@@ -43,7 +43,7 @@
<p class="notice">The date above differs from the release date of ${parent_item.display_name_with_default}, which is unset.
% else:
<p class="notice">The date above differs from the release date of ${parent_item.display_name_with_default}
${get_time_struct_display(parent_item.lms.start, '%m/%d/%Y at %I:%M %p')}.
${get_time_struct_display(parent_item.lms.start, '%m/%d/%Y at %H:%M UTC')}.
% endif
<a href="#" class="sync-date no-spinner">Sync to ${parent_item.display_name_with_default}.</a></p>
% endif

View File

@@ -162,7 +162,7 @@
<div class="section-published-date">
<%
start_date_str = get_time_struct_display(section.lms.start, '%m/%d/%Y')
start_time_str = get_time_struct_display(section.lms.start, '%I:%M %p')
start_time_str = get_time_struct_display(section.lms.start, '%H:%M UTC')
%>
%if section.lms.start is None:
<span class="published-status">This section has not been released.</span>

View File

@@ -15,7 +15,7 @@ def test_get_time_struct_display():
def test_get_default_time_display():
assert_equals("", date_utils.get_default_time_display(None))
test_time = time.struct_time((1992, 3, 12, 15, 3, 30, 1, 71, 0))
assert_equals("Mar 12, 1992 at 03:03 PM",
assert_equals("Mar 12, 1992 at 15:03 UTC",
date_utils.get_default_time_display(test_time))

View File

@@ -6,11 +6,11 @@ def get_default_time_display(time_struct):
"""
Converts a time struct to a string representation. This is the default
representation used in Studio and LMS.
It is of the form "Apr 09, 2013 at 04:00 PM".
It is of the form "Apr 09, 2013 at 16:00 UTC".
If None is passed in, an empty string will be returned.
"""
return get_time_struct_display(time_struct, "%b %d, %Y at %I:%M %p")
return get_time_struct_display(time_struct, "%b %d, %Y at %H:%M UTC")
def get_time_struct_display(time_struct, format):