[wp-trac] [WordPress Trac] #9272: Expand human_time_diff()'s abilities
WordPress Trac
wp-trac at lists.automattic.com
Sun Jan 8 22:40:13 UTC 2012
#9272: Expand human_time_diff()'s abilities
-------------------------------------------------+-------------------------
Reporter: Viper007Bond | Owner:
Type: enhancement | Viper007Bond
Priority: normal | Status: new
Component: Date/Time | Milestone: Future
Severity: normal | Release
Keywords: has-patch needs-testing rtl- | Version: 2.8
feedback | Resolution:
-------------------------------------------------+-------------------------
Comment (by dd32):
> `'years' => array( _x( '%d year', 'age' ), _x( '%d years', 'age' )
),`
I think we've got a helper for that here somewhere....
[http://core.trac.wordpress.org/browser/trunk//wp-includes/l10n.php#L257
_nx_noop()] and friends
> `return sprintf( $args['labels'][$smallest][0], 1 );`
I believe that should pass through the same translation process just for
consistency and filtering.
> I would like to see an option to add a cut-off option.
For the first round here, I'm not sure it's needed, but I prefer the
current methodology, If you pass something to it, you explicitly want a
'human time diff', If you want to display the date if it's older than a
month, that should be handled before the function is called.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/9272#comment:30>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list