mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Add two-way messaging view
> Once an inbound message has been received, there should be a way to > see the other messages in the system from the same service to the same > number. Both in and outbound. Nice inbox/whatsapp stylee view or some > such. This way the context of the reply is understood. > > Initially will only see the outbound template, not the actual message, > but we’re going to change this for the rest (soon), so that you can > always see the full message for all outbound.
This commit is contained in:
@@ -255,13 +255,20 @@ def format_datetime_relative(date):
|
||||
|
||||
|
||||
def get_human_day(time):
|
||||
|
||||
# Add 1 hour to get ‘midnight today’ instead of ‘midnight tomorrow’
|
||||
time = (gmt_timezones(time) - timedelta(hours=1)).strftime('%A')
|
||||
if time == datetime.utcnow().strftime('%A'):
|
||||
return 'today'
|
||||
if time == (datetime.utcnow() + timedelta(days=1)).strftime('%A'):
|
||||
time_as_day = (gmt_timezones(time) - timedelta(hours=1)).strftime('%A')
|
||||
six_days_ago = gmt_timezones((datetime.utcnow() + timedelta(days=-6)).isoformat())
|
||||
|
||||
if gmt_timezones(time) < six_days_ago:
|
||||
return format_date_short(time)
|
||||
if time_as_day == (datetime.utcnow() + timedelta(days=1)).strftime('%A'):
|
||||
return 'tomorrow'
|
||||
return time
|
||||
if time_as_day == datetime.utcnow().strftime('%A'):
|
||||
return 'today'
|
||||
if time_as_day == (datetime.utcnow() + timedelta(days=-1)).strftime('%A'):
|
||||
return 'yesterday'
|
||||
return format_date_short(time)
|
||||
|
||||
|
||||
def format_time(date):
|
||||
|
||||
Reference in New Issue
Block a user