Last modified: 2014-07-08 21:21:01 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T67794, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65794 - Document/differentiate between use cases of formatTimePeriod() and formatDuration()
Document/differentiate between use cases of formatTimePeriod() and formatDura...
Status: NEW
Product: MediaWiki
Classification: Unclassified
Internationalization (Other open bugs)
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
Blocks: documentation
  Show dependency treegraph
Reported: 2014-05-27 05:52 UTC by Kevin Israel (PleaseStand)
Modified: 2014-07-08 21:21 UTC (History)
11 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Kevin Israel (PleaseStand) 2014-05-27 05:52:54 UTC
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.
Comment 1 Niklas Laxström 2014-05-27 07:31:44 UTC
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).
Comment 2 Nemo 2014-05-27 08:02:55 UTC
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".
Comment 3 Gerrit Notification Bot 2014-07-08 20:42:46 UTC
Change 144765 had a related patch set uploaded by Jjanes:
Comment 4 Gerrit Notification Bot 2014-07-08 20:55:16 UTC
Change 144765 merged by jenkins-bot:
Comment 5 Gerrit Notification Bot 2014-07-08 21:04:00 UTC
Change 144824 had a related patch set uploaded by Jjanes:
Comment 6 Kevin Israel (PleaseStand) 2014-07-08 21:21:01 UTC
[Resetting status. Patch was for a different bug 67594.]

Note You need to log in before you can comment on or make changes to this bug.