Tstoeckler's comment (#8) in #1403508: show "just now" instead of "1 second ago" after posting nodes and comments made me realize that the variable naming in format_interval() could be improved slightly:
/**
* Formats a time interval with the requested granularity.
*
* @param $timestamp
* The length of the interval in seconds.
* [...]
*/
$timestamp is somewhat misleading here, since that should be differences of timestamps instead being an actual timestamp.
Comment | File | Size | Author |
---|---|---|---|
#6 | improve_variable_naming_format_interval-1416218-6.patch | 1.77 KB | scorchio |
#1 | improve_variable_naming_format_interval-1416218-1.patch | 1.83 KB | scorchio |
Comments
Comment #1
scorchio CreditAttribution: scorchio commentedHere's a patch which (hopefully) solves this issue.
Comment #3
tstoecklerTestbot is broken currently. When it is back up, this is RTBC.
Since this is only renaming an internal variable it constitutes a doc change (i.e. no API change), and hence can be backported all the way to D6 if I'm not mistaken.
Comment #4
Dries CreditAttribution: Dries commentedNice correction. Interval is the proper word. I think the 'just now' idea is pretty neat too.
Anyway, committed this patch to 8.x and 7.x. Moving it to 6.x in case Gabor wants to consider it.
Comment #5
Gábor HojtsyLooks like a good improvement, but does not apply to Drupal 6.
Comment #6
scorchio CreditAttribution: scorchio commentedThanks everyone - it feels great to do something for Drupal, even if it's just a tiny improvement like this :) Here's the one against 6.x.