Ticket #6449: django-date-filter.patch

File django-date-filter.patch, 526 bytes (added by Harm Geerts, 10 years ago)

patch that implements 'x' and 'X' to access the DATE_FORMAT and DATETIME_FORMAT

  • django/template/defaultfilters.py

     
    619619    from django.utils.dateformat import format
    620620    if not value:
    621621        return u''
    622     if arg is None:
     622    if arg in [None, 'x']:
    623623        arg = settings.DATE_FORMAT
     624    elif arg == 'X':
     625        arg = settings.DATETIME_FORMAT
    624626    return format(value, arg)
    625627date.is_safe = False
    626628
Back to Top