mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
notify-api-861 show eastern time
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
from datetime import datetime
|
||||
from functools import reduce
|
||||
|
||||
import pytz
|
||||
from dateutil import parser
|
||||
|
||||
from app.utils.csv import get_user_preferred_timezone
|
||||
|
||||
|
||||
def sum_of_statistics(delivery_statistics):
|
||||
statistics_keys = (
|
||||
@@ -24,6 +27,7 @@ def sum_of_statistics(delivery_statistics):
|
||||
|
||||
|
||||
def add_rates_to(delivery_statistics):
|
||||
et = pytz.timezone(get_user_preferred_timezone())
|
||||
return dict(
|
||||
emails_failure_rate=get_formatted_percentage(
|
||||
delivery_statistics["emails_failed"],
|
||||
@@ -33,7 +37,7 @@ def add_rates_to(delivery_statistics):
|
||||
delivery_statistics["sms_failed"], delivery_statistics["sms_requested"]
|
||||
),
|
||||
week_end_datetime=parser.parse(
|
||||
delivery_statistics.get("week_end", str(datetime.utcnow()))
|
||||
delivery_statistics.get("week_end", str(datetime.now(et)))
|
||||
),
|
||||
**delivery_statistics
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user