Opened 19 years ago

Closed 19 years ago

#1198 closed defect (fixed)

backslash-escape doesn't work on date filters

Reported by: inerte@… Owned by: Adrian Holovaty
Component: Template system Version: dev
Severity: blocker Keywords: filter, date
Cc: dcf@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

published on {{ object.pub_date|date:"jS o\f F" }}

Shows published on 9th o8:28 January

I was expecting the same behaviour as now, since that's what the documentation says...

BTW

It is the {% now "jS o\f F" %}

Shows It is the 10th of January

I am taking the liberty of setting the Severity to "blocker" since I wouldn't want to see this on a production enviroment :)

Change History (3)

comment:1 by dcf, 19 years ago

The cause appears to be the fact that the FilterExpression init method
strips out the '\' from constant args, so by the time the format string
gets to the format call, the format string has been modified to "js of F".

Anyone know why this is done?

comment:2 by anonymous, 19 years ago

Cc: dcf@… added

comment:3 by Russell Keith-Magee, 19 years ago

Resolution: fixed
Status: newclosed

(In [2713]) magic-removal: Fixed #1198 -- Modified handling of escape characters in filter arguments, and updated unit tests to reflect the change.

Note: See TracTickets for help on using tickets.
Back to Top