changed time column

This commit is contained in:
Beverly Nguyen
2024-01-23 16:18:43 -08:00
parent 8baf9682a1
commit 65bccb3f95
4 changed files with 28 additions and 13 deletions

View File

@@ -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(