mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 13:39:41 -04:00
Merge pull request #1362 from alphagov/letter-delivery-estimates
Add function to estimate letter delivery date
This commit is contained in:
@@ -7,7 +7,6 @@ from time import monotonic
|
||||
|
||||
import dateutil
|
||||
import itertools
|
||||
import pytz
|
||||
import ago
|
||||
from flask import (
|
||||
Flask,
|
||||
@@ -55,6 +54,8 @@ from app.notify_client.organisations_client import OrganisationsClient
|
||||
from app.notify_client.models import AnonymousUser
|
||||
from app.notify_client.letter_jobs_client import LetterJobsClient
|
||||
|
||||
from app.utils import gmt_timezones
|
||||
|
||||
login_manager = LoginManager()
|
||||
csrf = CsrfProtect()
|
||||
|
||||
@@ -212,12 +213,6 @@ def syntax_highlight_json(code):
|
||||
return Markup(highlight(code, JavascriptLexer(), HtmlFormatter(noclasses=True)))
|
||||
|
||||
|
||||
def gmt_timezones(date):
|
||||
date = dateutil.parser.parse(date)
|
||||
forced_utc = date.replace(tzinfo=pytz.utc)
|
||||
return forced_utc.astimezone(pytz.timezone('Europe/London'))
|
||||
|
||||
|
||||
def format_datetime(date):
|
||||
return '{} at {}'.format(
|
||||
format_date(date),
|
||||
|
||||
Reference in New Issue
Block a user