Code

Opened 8 years ago

Closed 8 years ago

#1198 closed defect (fixed)

backslash-escape doesn't work on date filters

Reported by: inerte@… Owned by: adrian
Component: Template system Version: master
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: UI/UX:

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 :)

Attachments (0)

Change History (3)

comment:1 Changed 8 years ago by dcf

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 Changed 8 years ago by anonymous

  • Cc dcf@… added

comment:3 Changed 8 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.