Opened 8 years ago

Closed 8 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: master
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


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 8 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 8 years ago by Harro

Cc: Harro added

comment:2 Changed 8 years ago by Aymeric Augustin

Triage Stage: UnreviewedDesign decision needed
Type: UncategorizedNew feature

comment:3 Changed 8 years ago by Jannis Leidel

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 but instead to the timesince and timeuntil.

Changed 8 years ago by Jannis Leidel

Attachment: 15921.1.diff added

comment:4 Changed 8 years ago by Jannis Leidel

Has patch: set

comment:5 Changed 8 years ago by Jannis Leidel

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