Skip to content

Commit

Permalink
Fix "Call to undefined method SMWDIError::getJD()" (#3607)
Browse files Browse the repository at this point in the history
  • Loading branch information
kghbln authored and mwjames committed Jan 13, 2019
1 parent e4fa39c commit af7577e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions includes/RecurringEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
* This class determines recurring events based on invoked parameters
*
* @see http://semantic-mediawiki.org/wiki/Help:Recurring_events
* @see https://www.semantic-mediawiki.org/wiki/Help:Recurring_events
*
* @license GNU GPL v2+
* @since 1.9
Expand Down Expand Up @@ -294,7 +294,9 @@ public function parse( array $parameters ) {
$date_str = "$cur_year-$display_month-$cur_day $cur_time";
$cur_date = DataValueFactory::getInstance()->newTypeIDValue( '_dat', $date_str );
$all_date_strings = array_merge( $all_date_strings, $included_dates);
$cur_date_jd = $cur_date->getDataItem()->getJD();
if ( $cur_date->isValid() ) {
$cur_date_jd = $cur_date->getDataItem()->getJD();
}
} elseif ( $unit == 'dayofweekinmonth' ) {
// e.g., "3rd Monday of every month"
$prev_month = $cur_date->getMonth();
Expand All @@ -304,7 +306,7 @@ public function parse( array $parameters ) {
if ( $new_month == 0 ) {
$new_month = 12;
}

$new_year = $prev_year + floor( ( $prev_month + $period - 1 ) / 12 );
$cur_date_jd += ( 28 * $period ) - 7;

Expand Down

0 comments on commit af7577e

Please sign in to comment.