Opened 4 years ago
Closed 4 years ago
#31623 closed New feature (fixed)
timesince 'depth' parameter
Reported by: | Toby Such | Owned by: | Tim Park |
---|---|---|---|
Component: | Utilities | Version: | dev |
Severity: | Normal | Keywords: | timesince |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description (last modified by )
Discussed here. The timesince function is a bit limiting as it is right now. A depth
parameter should be added to configure how many values are shown. The depth parameter should be defaulted to 2 as this is how the current implementation behaves. The existing rule of values having to be adjacent to one another should still remain.
The logic for calculating the time since, before formatting should also be pulled out of the function and placed in its own so that custom implementations can be created.
For example:
With a depth of one it should always display as "1 week" or "3 years" etc.
With a depth of two: "1 week, 3 days" or "3 years, 7 months"
With a depth of three: "1 week, 3 days, 5 hours" or "3 years, 7 months, 2 weeks"
Change History (9)
follow-up: 4 comment:1 by , 4 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 4 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 4 years ago
Description: | modified (diff) |
---|
comment:4 by , 4 years ago
Replying to Toby Such:
Hey Toby!
I started writing some of the core functionality needed for us to implement a depth feature. I'm happy to either (1) touch base with you before going any further or (2) take over this ticket completely.
Let me know.
comment:5 by , 4 years ago
Owner: | changed from | to
---|
comment:7 by , 4 years ago
Patch needs improvement: | set |
---|
comment:8 by , 4 years ago
Patch needs improvement: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
Refactoring (if necessary) can be done in a separate PR/ticket.
As discussed on the ML, the most important thing is to make it easily customizable.