Merge "Fix French special pages titles inconsistencies"
[lhc/web/wiklou.git] / includes / pager / ReverseChronologicalPager.php
index 3f96382..ee6e26c 100644 (file)
@@ -26,7 +26,7 @@
  * @ingroup Pager
  */
 abstract class ReverseChronologicalPager extends IndexPager {
-       public $mDefaultDirection = true;
+       public $mDefaultDirection = IndexPager::DIR_DESCENDING;
        public $mYear;
        public $mMonth;
 
@@ -113,6 +113,10 @@ abstract class ReverseChronologicalPager extends IndexPager {
                        $ymd = 20320101;
                }
 
-               $this->mOffset = $this->mDb->timestamp( "${ymd}000000" );
+               // Treat the given time in the wiki timezone and get a UTC timestamp for the database lookup
+               $timestamp = MWTimestamp::getInstance( "${ymd}000000" );
+               $timestamp->setTimeZone( $this->getConfig()->get( 'Localtimezone' ) );
+
+               $this->mOffset = $this->mDb->timestamp( $timestamp->getTimestamp() );
        }
 }