mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-11 09:28:27 -04:00
changed time column
This commit is contained in:
@@ -97,6 +97,20 @@ def format_datetime_short(date):
|
||||
format_date_short(date), format_time_24h(date), get_user_preferred_timezone()
|
||||
)
|
||||
|
||||
def format_datetime_short_america(date):
|
||||
return "{} at {} {}".format(
|
||||
format_date_normal_america(date), format_time_12h(date),get_user_preferred_timezone()
|
||||
)
|
||||
|
||||
def format_date_normal_america(date):
|
||||
date = parse_naive_dt(date)
|
||||
return date.strftime("%B %d, %Y").lstrip("0")
|
||||
|
||||
def format_time_12h(date):
|
||||
date = parse_naive_dt(date)
|
||||
|
||||
preferred_tz = pytz.timezone(get_user_preferred_timezone())
|
||||
return date.replace(tzinfo=timezone.utc).astimezone(preferred_tz).strftime("%I:%M %p")
|
||||
|
||||
def format_datetime_relative(date):
|
||||
return "{} at {} {}".format(
|
||||
|
||||
Reference in New Issue
Block a user