Add comments to explain time intervals

This commit is contained in:
Chris Hill-Scott
2020-05-13 08:53:40 +01:00
parent 864c6772b3
commit c61f7e70c2

View File

@@ -14,6 +14,8 @@ def _get_printing_day(created_at):
return func.date_trunc( return func.date_trunc(
'day', 'day',
func.timezone('Europe/London', func.timezone('UTC', created_at)) + text( func.timezone('Europe/London', func.timezone('UTC', created_at)) + text(
# We add 6 hours 30 minutes to the local created_at time so that
# any letters created after 5:30pm get shifted into the next day
"interval '6 hours 30 minutes'" "interval '6 hours 30 minutes'"
) )
) )
@@ -21,6 +23,7 @@ def _get_printing_day(created_at):
def _get_printing_datetime(created_at): def _get_printing_datetime(created_at):
return _get_printing_day(created_at) + text( return _get_printing_day(created_at) + text(
# Letters are printed from 5:30pm each day
"interval '17 hours 30 minutes'" "interval '17 hours 30 minutes'"
) )