r90390 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90389‎ | r90390 | r90391 >
Date:09:27, 19 June 2011
Author:aaron
Status:ok
Tags:
Comment:
Added back some rounding code lost in r90385
Modified paths:
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/Language.php
@@ -3436,7 +3436,15 @@
34373437 } elseif ( round( $seconds ) <= 2*86400 ) {
34383438 $hours = floor( $seconds / 3600 );
34393439 $minutes = floor( ( $seconds - $hours * 3600 ) / 60 );
3440 - $secondsPart = floor( $seconds - $hours * 3600 - $minutes * 60 );
 3440+ $secondsPart = round( $seconds - $hours * 3600 - $minutes * 60 );
 3441+ if ( $secondsPart == 60 ) {
 3442+ $secondsPart = 0;
 3443+ $minutes++;
 3444+ }
 3445+ if ( $minutes == 60 ) {
 3446+ $minutes = 0;
 3447+ $hours++;
 3448+ }
34413449 $s = $this->formatNum( $hours ) . $this->getMessageFromDB( 'hours-abbrev' ) .
34423450 ' ' .
34433451 $this->formatNum( $minutes ) . $this->getMessageFromDB( 'minutes-abbrev' );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90385* Added (and use) $format param to formatTimePeriod() to make output less ver...aaron07:25, 19 June 2011

Status & tagging log