Page MenuHomePhabricator

Document/differentiate between use cases of formatTimePeriod() and formatDuration()
Open, LowestPublic

Description

Here we have two methods of Language (formatTimePeriod() and formatDuration()) whose names mean pretty much the same thing. When to choose one over the other should be documented.

From what I can tell, the former supports abbreviating units and two specific strategies to avoid showing unnecessary units, yet the latter allows fine-grained control over which units to use (though does not allow abbreviation). However, it's unclear whether there are contexts in which one would be appropriate yet the other would not.


Version: 1.24rc
Severity: normal

Details

Reference
bz65794

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:25 AM
bzimport set Reference to bz65794.
bzimport added a subscriber: Unknown Object (MLST).

The time formatting functions are quite messy in MediaWiki. My gut feeling is that formatDuration is used for video/audio file lengths and formatTimePeriod for other things which can potentially by very long (more than years).

e5a9b38294da expanded formatTimePeriod(), mainly for some extension.
77d2f1676 only says that formatDuration()'s aim is to "easily render an amount of seconds for easier human reading".

Change 144765 had a related patch set uploaded by Jjanes:
PostgreSQL: Fix ORDER BY NULL

https://gerrit.wikimedia.org/r/144765

Change 144765 merged by jenkins-bot:
PostgreSQL: Fix ORDER BY NULL

https://gerrit.wikimedia.org/r/144765

Change 144824 had a related patch set uploaded by Jjanes:
PostgreSQL: Fix ORDER BY NULL

https://gerrit.wikimedia.org/r/144824

[Resetting status. Patch was for a different bug 67594.]

Aklapper triaged this task as Lowest priority.Jan 7 2015, 2:17 PM
Aklapper added a project: Documentation.
Aklapper set Security to None.