Opened 13 years ago

Closed 13 years ago

#16416 closed New feature (fixed)

date template tag should support "e" and "o" format character

Reported by: Carsten Fuchs Owned by: Dan Poirier
Component: Template system Version: 1.3
Severity: Normal Keywords: ISO 8601
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The date template tag currently supports the "W" (ISO 8601 week number) format character, but not the complementing "o" (ISO 8601 year number machting the ISO week number) character.

Both are described at the documentation that the date template tag is referring to:
http://de2.php.net/manual/en/function.date.php

A workaround is possible with a custom template tag, returning the result of datetime.strftime("%G").

Attachments (1)

16416.diff (4.6 KB ) - added by Dan Poirier 13 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Aymeric Augustin, 13 years ago

Summary: date template tag should support "o" format characterdate template tag should support "e" and "o" format character
Triage Stage: UnreviewedAccepted

Here's a list of the differences between what PHP supports and what Django supports:

b => added in Django
B => not implemented in Django
E => added in Django
e => not available in Django, added in PHP 5.1.0
f => added in Django
I => not implemented in Django
N => added in Django, added in PHP 5.1.0 with a different meaning
o => not available in Django, added in PHP 5.1.0
P => added in Django, added in PHP 5.1.3 with a different meaning

We should implement e and o, or mention in the docs that they're not implemented, like B and I.

Also, iven the divergence of N and P, maybe we could drop the reference to PHP from the docs.

Version 1, edited 13 years ago by Aymeric Augustin (previous) (next) (diff)

comment:2 by Dan Poirier, 13 years ago

Owner: changed from nobody to Dan Poirier
Status: newassigned

by Dan Poirier, 13 years ago

Attachment: 16416.diff added

comment:3 by Dan Poirier, 13 years ago

Has patch: set

comment:4 by Jannis Leidel, 13 years ago

Triage Stage: AcceptedReady for checkin

comment:5 by Jannis Leidel, 13 years ago

Resolution: fixed
Status: assignedclosed

In [17473]:

Fixed #16416 -- Added two new date formatting options for timezones and ISO week numbers. Thanks, poirier.

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