#NEWLINE# def format_date( d , if_none = '' ) : #NEWLINE# #INDENT# "\n    Format a date in a nice human readable way: Omit the year if it's the\n    current year. Also return a default value if no date is passed in.\n    " #NEWLINE# if ( d is None ) : #NEWLINE# #INDENT# return if_none #NEWLINE# #UNINDENT# now = timezone . now ( ) #NEWLINE# fmt = ( ( ( d . year == now . year ) and '%d.%m' ) or '%d.%m.%Y' ) #NEWLINE# return d . strftime ( now )