Opened 14 years ago

Closed 14 years ago

#15921 closed New feature (fixed)

naturaltime filter should only work with time, current filter should be renamed to naturaldatetime

Reported by: Harro Owned by: nobody
Component: contrib.humanize Version: dev
Severity: Normal Keywords:
Cc: Harro Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In relation to #12771 and [16071]:

The naturalday filter only works with dates, I think naturaltime should only work with times.

I propose changing it a bit so you can use them combined with this as the output:

today, 1 second ago
today, 1 hour ago
yesterday, 9:00
yesterday, 21:00

26-04-2011, 21:00

I suggest adding a third which used naturaltime and naturalday combined to create the current functionality.

naturaldatetime oid.

Attachments (1)

15921.1.diff (13.8 KB ) - added by Jannis Leidel 14 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Harro, 14 years ago

Cc: Harro added

comment:2 by Aymeric Augustin, 14 years ago

Triage Stage: UnreviewedDesign decision needed
Type: UncategorizedNew feature

comment:3 by Jannis Leidel, 14 years ago

Triage Stage: Design decision neededAccepted

Yeah, that filter is really not that good (the ungettext calls aren't passed the arguments).

I also agree that it should be solely a time based filter and not fall back to defaultfilters.date but instead to the timesince and timeuntil.

by Jannis Leidel, 14 years ago

Attachment: 15921.1.diff added

comment:4 by Jannis Leidel, 14 years ago

Has patch: set

comment:5 by Jannis Leidel, 14 years ago

Resolution: fixed
Status: newclosed

In [16233]:

Fixed #15921 -- Refined naturaltime filter added in r16071 to use timesince and timeuntil filters as fallbacks instead of date filter.

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