Files @ abcbe1f7c9d0
Branch filter:

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

pono
change footer from twitter to X
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)))