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

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
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.