diff --git a/app/__init__.py b/app/__init__.py index 47a3c15e4..6d3994949 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -53,7 +53,6 @@ from app.formatters import ( format_datetime_normal, format_datetime_relative, format_datetime_short, - format_datetime_short_america, format_day_of_week, format_delta, format_delta_days, @@ -553,7 +552,6 @@ def add_template_filters(application): format_datetime_24h, format_datetime_normal, format_datetime_short, - format_datetime_short_america, valid_phone_number, linkable_name, format_date, diff --git a/app/formatters.py b/app/formatters.py index 543167d9c..24da3c5ef 100644 --- a/app/formatters.py +++ b/app/formatters.py @@ -93,21 +93,9 @@ def format_datetime_normal(date): def format_datetime_short(date): - return "{} at {} {}".format( - format_date_short(date), format_time_24h(date), get_user_preferred_timezone() - ) - - -def format_datetime_short_america(date): - return "{} at {}".format(format_date_numeric_america(date), format_time_12h(date)) - - -def format_date_numeric_america(date): - date = parse_naive_dt(date) - - preferred_tz = pytz.timezone(get_user_preferred_timezone()) - return ( - date.replace(tzinfo=timezone.utc).astimezone(preferred_tz).strftime("%m-%d-%Y") + # example: 03-18-2024 at 04:53 PM + return "{} at {}".format( + format_date_numeric(date), format_time_12h(date) ) @@ -137,7 +125,7 @@ def format_date_numeric(date): preferred_tz = pytz.timezone(get_user_preferred_timezone()) return ( - date.replace(tzinfo=timezone.utc).astimezone(preferred_tz).strftime("%Y-%m-%d") + date.replace(tzinfo=timezone.utc).astimezone(preferred_tz).strftime("%m-%d-%Y") ) diff --git a/app/templates/components/table.html b/app/templates/components/table.html index a76f2c6bd..50eb73d9a 100644 --- a/app/templates/components/table.html +++ b/app/templates/components/table.html @@ -171,8 +171,8 @@ {% endif %}

{{ notification.status|format_notification_status_as_time( - notification.created_at|format_datetime_short_america, - (notification.sent_at or notification.created_at)|format_datetime_short_america + notification.created_at|format_datetime_short, + (notification.sent_at or notification.created_at)|format_datetime_short ) }}

{% if displayed_on_single_line %}{% endif %} diff --git a/app/templates/partials/jobs/status.html b/app/templates/partials/jobs/status.html index b24051211..703050e8d 100644 --- a/app/templates/partials/jobs/status.html +++ b/app/templates/partials/jobs/status.html @@ -2,12 +2,12 @@

{% if job.scheduled_for %} {% if job.processing_started %} - Sent by {{ job.created_by.name }} on {{ job.processing_started|format_datetime_short_america }} + Sent by {{ job.created_by.name }} on {{ job.processing_started|format_datetime_short }} {% else %} - Uploaded by {{ job.created_by.name }} on {{ job.created_at|format_datetime_short_america }} + Uploaded by {{ job.created_by.name }} on {{ job.created_at|format_datetime_short }} {% endif %} {% else %} - Sent by {{ job.created_by.name }} on {{ job.created_at|format_datetime_short_america }} + Sent by {{ job.created_by.name }} on {{ job.created_at|format_datetime_short }} {% endif %}

{% if job.status == 'sending limits exceeded'%} diff --git a/app/templates/views/dashboard/dashboard.html b/app/templates/views/dashboard/dashboard.html index c19b837ad..d61ab3f9c 100644 --- a/app/templates/views/dashboard/dashboard.html +++ b/app/templates/views/dashboard/dashboard.html @@ -68,7 +68,7 @@ {{ notification.template.name }} - {{ job.created_at | format_datetime_short_america }} + {{ job.created_at | format_datetime_short }} {{ notification.created_by.name }}