﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
3311	"New humanize filter ""naturalday"" (yesterday, today, tomorrow)"	exogen@…	Adrian Holovaty	"Just something I think people might want in humanize or defaultfilters. This will return 'yesterday', 'today', and 'tomorrow' when the given date has the appropriate relation with the current date. Otherwise, return the full day name. Maybe it could even be extended to do 'last Tuesday', 'this Tuesday', or 'next Tuesday' when appropriate. Anyway the idea is that it is very common to hear this method of communicating the day in speech.

{{{
import datetime

def naturalday(value):
    today = datetime.date.today()
    value = datetime.date(value.year, value.month, value.day)
    delta = datetime.timedelta(days=1)
    if value == today:
        return 'today'
    elif value == today + delta:
        return 'tomorrow'
    elif value == today - delta:
        return 'yesterday'
    return value.strftime('%A')
}}}"	enhancement	closed	Template system		normal	fixed		jyrki.pulliainen@…	Ready for checkin	1	0	0	0	0	0
