Opened 18 years ago
Closed 18 years ago
#3488 closed (fixed)
DateFormat should have a b() method
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Tools | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Design decision needed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The date-based generic views use %b
as the default month formatter:
def archive_day(... month_format='%b' ...): [snip] date = datetime.date(*time.strptime(year+month+day, '%Y'+month_format+day_format)[:3])
and in my template I would like to link to the previous/next day with something like:
<a href="/log/{{ previous_day|date:"Y/b/d/" }}">Previous day</a>
but can't since django.utils.dateformat.DateFormat
has no b()
method.
Note that you could work around this using the lower
template filter:
<a href="/log/{{ previous_day|date:"Y/M/d/"|lower }}">Previous day</a>
but having to work around this seems silly since %b
is the default used in the generic views.
Attachments (1)
Change History (5)
by , 18 years ago
comment:1 by , 18 years ago
Has patch: | set |
---|---|
Triage Stage: | Unreviewed → Design decision needed |
comment:2 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 18 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
D'oh, I meant #3448. My dyslexia is really acting up these days.
comment:4 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Note:
See TracTickets
for help on using tickets.
patch and docs