Opened 4 years ago

Closed 4 years ago

#15921 closed New feature (fixed)

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

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


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 jezdez 4 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 4 years ago by hvdklauw

  • Cc hvdklauw added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 4 years ago by aaugustin

  • Triage Stage changed from Unreviewed to Design decision needed
  • Type changed from Uncategorized to New feature

comment:3 Changed 4 years ago by jezdez

  • Triage Stage changed from Design decision needed to Accepted

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 4 years ago by jezdez

comment:4 Changed 4 years ago by jezdez

  • Has patch set

comment:5 Changed 4 years ago by jezdez

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

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