[wp-trac] [WordPress Trac] #9272: Expand human_time_diff()'s abilities

WordPress Trac wp-trac at lists.automattic.com
Sun Jan 8 22:10:26 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 Viper007Bond):

 Replying to [comment:28 petervanderdoes]:
 > I would like to see an option to add a cut-off option.
 > What I mean is when I call the function and the difference is more as Y
 I just want to display the date. As mentioned the output of "X decades" is
 not foreseen, the cut-off option would give the option to the users how
 far the want to go with the display of X units.
 >
 > The cut-off can be in seconds and when the diff in line 1958 is bigger
 output normal date format, or return false and have the developer check
 for false.
 > A cut-off value of false would keep the current functionality and that
 would be the default value.

 This is currently how core uses the function, although it does it
 manually:

 https://core.trac.wordpress.org/browser/tags/3.3.1/wp-admin/includes
 /class-wp-posts-list-table.php#L573

 Supporting that through the function itself is an interesting proposal,
 but I'll wait to see what others think before adding any code.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9272#comment:29>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list