#NEWLINE# @ register . filter #NEWLINE# def date( value , arg = None ) : #NEWLINE# #INDENT# 'Formats a date according to the given format.' #NEWLINE# if ( not value ) : #NEWLINE# #INDENT# return '' #NEWLINE# #UNINDENT# if ( arg is None ) : #NEWLINE# #INDENT# arg = settings . DATE_FORMAT #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# return formats . date_format ( value , arg ) #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return format ( value , arg ) #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# return ''