diff --git a/django/contrib/humanize/templatetags/humanize.py b/django/contrib/humanize/templatetags/humanize.py index 6095813b06..194c7e8fbb 100644 --- a/django/contrib/humanize/templatetags/humanize.py +++ b/django/contrib/humanize/templatetags/humanize.py @@ -187,15 +187,12 @@ def naturalday(value, arg=None): present day return representing string. Otherwise, return a string formatted according to settings.DATE_FORMAT. """ + tzinfo = getattr(value, 'tzinfo', None) try: - tzinfo = getattr(value, 'tzinfo', None) value = date(value.year, value.month, value.day) except AttributeError: # Passed value wasn't a date object return value - except ValueError: - # Date arguments out of range - return value today = datetime.now(tzinfo).date() delta = value - today if delta.days == 0: