"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
);
/**
'minutes' => '{{PLURAL:$1|$1 minute|$1 minutes}}',
'hours' => '{{PLURAL:$1|$1 hour|$1 hours}}',
'days' => '{{PLURAL:$1|$1 day|$1 days}}',
+'months' => '{{PLURAL:$1|$1 month|$1 months}}',
+'years' => '{{PLURAL:$1|$1 year|$1 years}}',
'ago' => '$1 ago',
'just-now' => 'just now',
Part of variable $1 in {{msg-mw|Ago}}
{{Identical|Day}}',
+'months' => 'Full word for "months". $1 is the number of months.
+
+Part of variable $1 in {{msg-mw|Ago}}',
+'years' => 'Full word for "years". $1 is the number of years.
+
+Part of variable $1 in {{msg-mw|Ago}}',
'ago' => 'Phrase for indicating how long ago something happened. $1 is something like "3 days 10 hours", taken from these messages:
*{{msg-mw|Seconds}}
*{{msg-mw|Minutes}}
*{{msg-mw|Hours}}
-*{{msg-mw|Days}}',
+*{{msg-mw|Days}}
+*{{msg-mw|Months}}
+*{{msg-mw|Years}}',
+
'just-now' => 'Phrase for indicating something happened just now.',
# Bad image list
'minutes',
'hours',
'days',
+ 'months',
+ 'years',
'ago',
'just-now',
),
function testHumanOutput() {
$timestamp = new MWTimestamp( time() - 3600 );
$this->assertEquals( "1 hour ago", $timestamp->getHumanTimestamp()->inLanguage( 'en' )->text() );
+ $timestamp = new MWTimestamp( time() - 5184000 );
+ $this->assertEquals( "2 months ago", $timestamp->getHumanTimestamp()->inLanguage( 'en' )->text() );
+ $timestamp = new MWTimestamp( time() - 31536000 );
+ $this->assertEquals( "1 year ago", $timestamp->getHumanTimestamp()->inLanguage( 'en' )->text() );
}
/**