MDL-59890 calendar: Stop adding time for mini view - not used
authorAndrew Nicols <andrew@nicols.co.uk>
Tue, 19 Sep 2017 03:16:30 +0000 (11:16 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Tue, 3 Oct 2017 13:28:31 +0000 (21:28 +0800)
blocks/calendar_month/block_calendar_month.php
calendar/lib.php

index 18a57d7..6833188 100644 (file)
@@ -38,32 +38,16 @@ class block_calendar_month extends block_base {
     public function get_content() {
         global $CFG;
 
-        $calm = optional_param('cal_m', 0, PARAM_INT);
-        $caly = optional_param('cal_y', 0, PARAM_INT);
-        $time = optional_param('time', 0, PARAM_INT);
-
         require_once($CFG->dirroot.'/calendar/lib.php');
 
         if ($this->content !== null) {
             return $this->content;
         }
 
-        // If a day, month and year were passed then convert it to a timestamp. If these were passed then we can assume
-        // the day, month and year are passed as Gregorian, as no where in core should we be passing these values rather
-        // than the time. This is done for BC.
-        if (!empty($calm) && (!empty($caly))) {
-            $time = make_timestamp($caly, $calm, 1);
-        } else if (empty($time)) {
-            $time = time();
-        }
-
         $this->content = new stdClass;
         $this->content->text = '';
         $this->content->footer = '';
 
-        // [pj] To me it looks like this if would never be needed, but Penny added it
-        // when committing the /my/ stuff. Reminder to discuss and learn what it's about.
-        // It definitely needs SOME comment here!
         $courseid = $this->page->course->id;
         $issite = ($courseid == SITEID);
 
@@ -80,7 +64,7 @@ class block_calendar_month extends block_base {
 
         $renderer = $this->page->get_renderer('core_calendar');
 
-        $calendar = new calendar_information(0, 0, 0, $time);
+        $calendar = new calendar_information();
         $calendar->prepare_for_view($course, $courses);
 
         list($data, $template) = calendar_get_view($calendar, 'mini');
index 6b46115..4d86ee2 100644 (file)
@@ -1012,7 +1012,7 @@ class calendar_information {
      * @return  $this
      */
     public function set_time($time = null) {
-        if ($time === null) {
+        if (empty($time)) {
             $this->time = time();
         } else {
             $this->time = $time;