sehmaschine/django-grappelli — pull request #364 by meric (2013-08-29 12:26:09+00:00)
Title: datetime javascript tweak

I overrode the AdminDateTime to show the timezone, but there's this bit of javascript in grappelli that seems overly aggressive at removing the labels of the datetimefield.

Without fix:
![screen shot 2013-08-29 at 10 13 51 pm](https://f.cloud.github.com/assets/374396/1049404/94c91624-10a4-11e3-9e97-e6464b0b607f.png)

With fix:
![screen shot 2013-08-29 at 10 12 12 pm](https://f.cloud.github.com/assets/374396/1049394/48a86146-10a4-11e3-998c-bc265afdc8ee.png)

The "<" character shouldn't ever be in the label; It'd be escaped as "<". I inserted a "<" into the "Time:" label while overriding the AdminDateTime and logged the resulting `a(this).html()`:

def format_output(self, rendered_widgets):

return format_html('

{0} {1}
{2} {3}
{4} {5}

',
_('Date:'), rendered_widgets[0],
_('
<Time:

As you can see the "<" gets replaced into "&lt;" when rendered onto the template, therefore the proposed change to the regex will provide strictly better behaviour.

Of course, overriding the AdminDateTime is quite an unorthodox thing to do...