* (Bug 25451) Language::time() and ::date() misfunction when given timestamps in...
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Thu, 14 Oct 2010 15:59:20 +0000 (15:59 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Thu, 14 Oct 2010 15:59:20 +0000 (15:59 +0000)
Convert given times to correct format like ::timeandate() already does.
Based on patch by Thorsten Glaser <tg@debian.org>.

languages/Language.php

index 09c66ad..fa605ab 100644 (file)
@@ -1496,6 +1496,7 @@ class Language {
         * @return string
         */
        function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
+               $ts = wfTimestamp( TS_MW, $ts );
                if ( $adj ) {
                        $ts = $this->userAdjust( $ts, $timecorrection );
                }
@@ -1514,6 +1515,7 @@ class Language {
         * @return string
         */
        function time( $ts, $adj = false, $format = true, $timecorrection = false ) {
+               $ts = wfTimestamp( TS_MW, $ts );
                if ( $adj ) {
                        $ts = $this->userAdjust( $ts, $timecorrection );
                }