mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-01 22:51:10 -04:00
Add a page to show delivery rates week-by-week
Implements https://github.com/alphagov/notifications-api/pull/286 Will always show weeks as Monday to Sunday.
This commit is contained in:
@@ -101,6 +101,7 @@ def create_app():
|
||||
application.add_template_filter(valid_phone_number)
|
||||
application.add_template_filter(linkable_name)
|
||||
application.add_template_filter(format_date)
|
||||
application.add_template_filter(format_date_short)
|
||||
|
||||
application.after_request(useful_headers_after_request)
|
||||
application.after_request(save_service_after_request)
|
||||
@@ -201,6 +202,11 @@ def format_date(date):
|
||||
return date.strftime('%A %d %B %Y')
|
||||
|
||||
|
||||
def format_date_short(date):
|
||||
date = dateutil.parser.parse(date)
|
||||
return date.strftime('%d %B').lstrip('0')
|
||||
|
||||
|
||||
def valid_phone_number(phone_number):
|
||||
try:
|
||||
validate_phone_number(phone_number)
|
||||
|
||||
Reference in New Issue
Block a user