+ return $this->mOffset;
+ }
+
+ /**
+ * Core logic of determining the mOffset timestamp such that we can get all items with
+ * a timestamp up to the specified parameters. Given parameters for a day up to which to get
+ * items, this function finds the timestamp of the day just after the end of the range for use
+ * in an database strict inequality filter.
+ *
+ * This is separate from getDateCond so we can use this logic in other places, such as in
+ * RangeChronologicalPager, where this function is used to convert year/month/day filter options
+ * into a timestamp.
+ *
+ * @param int $year Year up to which we want revisions
+ * @param int $month Month up to which we want revisions
+ * @param int $day [optional] Day up to which we want revisions. Default is end of month.
+ * @return MWTimestamp Timestamp or null if year and month are false/invalid
+ */
+ public static function getOffsetDate( $year, $month, $day = -1 ) {
+ // Given an optional year, month, and day, we need to generate a timestamp
+ // to use as "WHERE rev_timestamp <= result"
+ // Examples: year = 2006 equals < 20070101 (+000000)
+ // year=2005, month=1 equals < 20050201
+ // year=2005, month=12 equals < 20060101
+ // year=2005, month=12, day=5 equals < 20051206
+ if ( $year <= 0 ) {