Added back some rounding code lost in r90385
authorAaron Schulz <aaron@users.mediawiki.org>
Sun, 19 Jun 2011 09:27:08 +0000 (09:27 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sun, 19 Jun 2011 09:27:08 +0000 (09:27 +0000)
languages/Language.php

index 0a5fc25..26fdbc5 100644 (file)
@@ -3436,7 +3436,15 @@ class Language {
                } elseif ( round( $seconds ) <= 2*86400 ) {
                        $hours = floor( $seconds / 3600 );
                        $minutes = floor( ( $seconds - $hours * 3600 ) / 60 );
-                       $secondsPart = floor( $seconds - $hours * 3600 - $minutes * 60 );
+                       $secondsPart = round( $seconds - $hours * 3600 - $minutes * 60 );
+                       if ( $secondsPart == 60 ) {
+                               $secondsPart = 0;
+                               $minutes++;
+                       }
+                       if ( $minutes == 60 ) {
+                               $minutes = 0;
+                               $hours++;
+                       }
                        $s = $this->formatNum( $hours ) . $this->getMessageFromDB( 'hours-abbrev' ) .
                                ' ' .
                                $this->formatNum( $minutes ) . $this->getMessageFromDB( 'minutes-abbrev' );