Ticket #109: custom-datetime-1.diff

File custom-datetime-1.diff, 1.1 KB (added by Manuzhai, 15 years ago)

Handling a customizable datetime-formatting.

  • views/admin/main.py

     
    77from django.utils.html import strip_tags
    88from django.utils.httpwrappers import HttpResponse, HttpResponseRedirect
    99from django.utils.text import get_text_list
    10 from django.conf.settings import ADMIN_MEDIA_PREFIX
     10from django.conf.settings import ADMIN_MEDIA_PREFIX, DATETIME_FORMAT
    1111import operator
    1212
    1313# Text to display within changelist table cells if the value is blank.
     
    402402                    elif isinstance(f, meta.DateField):
    403403                        if field_val:
    404404                            if isinstance(f, meta.DateTimeField):
    405                                 result_repr = dateformat.format(field_val, 'N j, Y, P')
     405                                result_repr = dateformat.format(field_val, DATETIME_FORMAT)
    406406                            else:
    407407                                result_repr = dateformat.format(field_val, 'N j, Y')
    408408                        else:
Back to Top