Merge "Use a LinkBatch for the creator/last editor user (talk) pages in InfoAction"
[lhc/web/wiklou.git] / includes / Timestamp.php
index a5844b6..630ac53 100644 (file)
@@ -54,7 +54,9 @@ class MWTimestamp {
                "seconds" => 1000, // 1000 milliseconds per second
                "minutes" => 60, // 60 seconds per minute
                "hours" => 60, // 60 minutes per hour
-               "days" => 24 // 24 hours per day
+               "days" => 24, // 24 hours per day
+               "months" => 30, // approximately 30 days per month
+               "years" => 12, // 12 months per year
        );
 
        /**
@@ -196,7 +198,7 @@ class MWTimestamp {
         *
         * @since 1.20
         *
-        * @return string Formatted timestamp
+        * @return Message Formatted timestamp
         */
        public function getHumanTimestamp() {
                $then = $this->getTimestamp( TS_UNIX );
@@ -216,7 +218,7 @@ class MWTimestamp {
 
                if( $message ) {
                        $initial = call_user_func_array( 'wfMessage', $message );
-                       return wfMessage( 'ago', $initial );
+                       return wfMessage( 'ago', $initial->parse() );
                } else {
                        return wfMessage( 'just-now' );
                }