mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 06:21:50 -05:00
Changed the scheduled_for datetime to only send and hour of a day to send.
Also expect the date being passed in is BST. The date is converted to UTC before saving. And converted to BST when returning a notification.
This commit is contained in:
@@ -51,10 +51,14 @@ def get_midnight_for_day_before(date):
|
||||
return get_london_midnight_in_utc(day_before)
|
||||
|
||||
|
||||
def get_utc_time_in_bst(utc_dt):
|
||||
def convert_utc_time_in_bst(utc_dt):
|
||||
return pytz.utc.localize(utc_dt).astimezone(local_timezone).replace(tzinfo=None)
|
||||
|
||||
|
||||
def convert_bst_to_utc(date):
|
||||
return local_timezone.localize(date).astimezone(pytz.UTC).replace(tzinfo=None)
|
||||
|
||||
|
||||
def get_london_month_from_utc_column(column):
|
||||
"""
|
||||
Where queries need to count notifications by month it needs to be
|
||||
|
||||
Reference in New Issue
Block a user