[wp-trac] [WordPress Trac] #9272: Expand human_time_diff()'s abilities
WordPress Trac
wp-trac at lists.automattic.com
Sun Jan 8 13:20:41 UTC 2012
#9272: Expand human_time_diff()'s abilities
-------------------------------------+-----------------------------
Reporter: Viper007Bond | Owner: Viper007Bond
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Date/Time | Version: 2.8
Severity: normal | Resolution:
Keywords: has-patch needs-testing |
-------------------------------------+-----------------------------
Comment (by Viper007Bond):
Alright, quite a few changes. :)
* Now accepts arguments as an array. Props dd32.
* Added "context" parameter that controls how the unit names are
translated. Are more contexts needed? For example past versus future? Dumb
English speaker here. :)
* The separator can be controlled via the arguments, as can the unit
labels.
* Removed the units filter. This function won't work with units smaller
than a second and I don't forsee people wanting to output "X decades". ;)
* Add two helper functions per dd32's idea for the difference usage
contexts. '''TODO:''' Go through existing usages of `human_time_diff()` in
core and replace them with the context helper functions.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/9272#comment:26>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list