r91616 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91615‎ | r91616 | r91617 >
Date:22:38, 6 July 2011
Author:nimishg
Status:deferred
Tags:
Comment:
added one month to 'end month' to account for how the data is stored in the db
Modified paths:
  • /trunk/extensions/MetricsReporting/ApiAnalyticsBase.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetricsReporting/ApiAnalyticsBase.php
@@ -47,8 +47,11 @@
4848 if ( $params['startmonth'] && !$params['endmonth'] ) {
4949 $query['conds']['date'] = $params['startmonth'];
5050 } else {
 51+ //add 1 month to end of date because of the way data is stored
 52+ $endMonth = date( "Y-m-d", strtotime( $params['endmonth'] . " +1 month" ) );
 53+
5154 $query['conds'][] = "date >= ". $db->addQuotes( $params['startmonth'] )
52 - . " AND date <= " . $db->addQuotes( $params['endmonth'] ) ;
 55+ . " AND date <= " . $db->addQuotes( $endMonth ) ;
5356 }
5457
5558 // TODO: Data formatting

Status & tagging log