mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 00:20:43 -04:00
Move date-checking logic to utils and unit test it
This commit is contained in:
@@ -676,3 +676,9 @@ def format_thousands(value):
|
||||
if value is None:
|
||||
return ''
|
||||
return value
|
||||
|
||||
|
||||
def is_less_than_90_days_ago(date_from_db):
|
||||
return (datetime.utcnow() - datetime.strptime(
|
||||
date_from_db, '%a, %d %b %Y %X %Z'
|
||||
)).days < 90
|
||||
|
||||
Reference in New Issue
Block a user