Always use 12h times

The GOV.UK content style guide says:

> - 5:30pm (not 1730hrs)
> - midnight (not 00:00)
> - midday (not 12 noon, noon or 12pm)

This commit changes all times to be 12h not 24h, and adds a special case
for when a time is exactly 12:00am or 12:00pm.
This commit is contained in:
Chris Hill-Scott
2016-08-26 08:06:28 +01:00
parent c1415c0429
commit 3d8d160d3e
5 changed files with 37 additions and 14 deletions

View File

@@ -89,7 +89,7 @@ def get_errors_for_csv(recipients, template_type):
def generate_notifications_csv(json_list):
from app import format_datetime, format_notification_status
from app import format_datetime_24h, format_notification_status
content = StringIO()
retval = None
with content as csvfile:
@@ -103,7 +103,7 @@ def generate_notifications_csv(json_list):
x['template']['template_type'],
x['job']['original_file_name'] if x['job'] else '',
format_notification_status(x['status'], x['template']['template_type']),
format_datetime(x['created_at'])])
format_datetime_24h(x['created_at'])])
retval = content.getvalue()
return retval