notify-542: move to 24 hour time for UTC

This commit is contained in:
Kenneth Kehl
2023-06-26 08:42:04 -07:00
parent 63d5061423
commit ed274bd266
4 changed files with 43 additions and 57 deletions

View File

@@ -66,7 +66,6 @@ from app.formatters import (
format_notification_type,
format_number_in_pounds_as_currency,
format_thousands,
format_time,
format_yes_no,
id_safe,
iteration_count,
@@ -543,7 +542,6 @@ def add_template_filters(application):
format_datetime_24h,
format_datetime_normal,
format_datetime_short,
format_time,
valid_phone_number,
linkable_name,
format_date,

View File

@@ -36,7 +36,7 @@ def convert_to_boolean(value):
def format_datetime(date):
return '{} at {}'.format(
format_date(date),
format_time(date)
format_time_24h(date)
)
@@ -50,21 +50,21 @@ def format_datetime_24h(date):
def format_datetime_normal(date):
return '{} at {}'.format(
format_date_normal(date),
format_time(date)
format_time_24h(date)
)
def format_datetime_short(date):
return '{} at {}'.format(
format_date_short(date),
format_time(date)
format_time_24h(date)
)
def format_datetime_relative(date):
return '{} at {}'.format(
get_human_day(date),
format_time(date)
format_time_24h(date)
)
@@ -110,17 +110,6 @@ def get_human_day(time, date_prefix=''):
).strip()
def format_time(date):
date = parse_naive_dt(date)
return {
'12:00AM': 'Midnight',
'12:00PM': 'Noon'
}.get(
date.strftime('%-I:%M%p'),
date.strftime('%-I:%M%p')
).lower()
def format_date(date):
date = parse_naive_dt(date)
return date.strftime('%A %d %B %Y')
@@ -143,7 +132,7 @@ def format_date_human(date):
def format_datetime_human(date, date_prefix=''):
return '{} at {}'.format(
get_human_day(date, date_prefix='on'),
format_time(date),
format_time_24h(date),
)