Files @ 6c52f28d6a3c
Branch filter:

Location: website/conservancy/news/templatetags/date_within.py

Denver Gingerich
Use The Source: add initial CCIRT text
from datetime import datetime, timedelta

from django import template

register = template.Library()

@register.filter
def date_within_past_days(value, arg):
    # question: does datetime.now() do a syscall each time is it called?
    return value > (datetime.now() - timedelta(days=int(arg)))