[wp-trac] [WordPress Trac] #38773: Calculation error in human_time_diff
WordPress Trac
noreply at wordpress.org
Fri Jan 27 18:20:21 UTC 2017
#38773: Calculation error in human_time_diff
----------------------------------------+------------------------------
Reporter: SGr33n | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Date/Time | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests | Focuses:
----------------------------------------+------------------------------
Comment (by adamsilverstein):
[attachment:38773.4.diff]
Add unit tests verifying the current rounding behavior of
`human_time_diff`.
@SGr33n We aren't going to change this long-established behavior, by now
the rounding is expected. if you want to change the core behavior to using
`floor`, you can use the filter that runs at the end of the function, add
something
[https://gist.github.com/adamsilverstein/3865e2faa0bf32585d765c418862904d
like this].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38773#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list