Skip to content
Permalink
Browse files

Merge branch 'MDL-65067_36' of https://github.com/dmonllao/moodle int…

…o MOODLE_36_STABLE
  • Loading branch information...
abgreeve committed May 22, 2019
2 parents d3f44d6 + 7ad4cd3 commit 3377d26e2a750ab9b45fa410e6a04ff96fe969b8
@@ -173,7 +173,8 @@ function tool_analytics_calculate_course_dates($course, $options) {
$formatoptions = $format->get_format_options();
// Change this for a course formats API level call in MDL-60702.
if (method_exists($format, 'update_end_date') && $formatoptions['automaticenddate']) {
if ((get_class($format) == 'format_weeks' || is_subclass_of($format, 'format_weeks')) &&
method_exists($format, 'update_end_date') && $formatoptions['automaticenddate']) {
// Special treatment for weeks-based formats with automatic end date.
if ($options['update']) {
@@ -836,7 +836,8 @@ protected function activity_completed_by(\cm_info $activity, $starttime, $endtim
// When the course is using format weeks we use the week's end date.
$format = course_get_format($activity->get_modinfo()->get_course());
// We should change this in MDL-60702.
if (method_exists($format, 'get_section_dates')) {
if ((get_class($format) == 'format_weeks' || is_subclass_of($format, 'format_weeks'))
&& method_exists($format, 'get_section_dates')) {
$dates = $format->get_section_dates($section);
// We need to consider the +2 hours added by get_section_dates.

0 comments on commit 3377d26

Please sign in to comment.
You can’t perform that action at this time.