MDL-49473 logs: ensure exported logs contain year
authorDan Poltawski <dan@moodle.com>
Tue, 3 Nov 2015 11:37:24 +0000 (11:37 +0000)
committerDan Poltawski <dan@moodle.com>
Tue, 3 Nov 2015 11:37:24 +0000 (11:37 +0000)
report/log/classes/table_log.php

index 0b17739..8edd4ec 100644 (file)
@@ -158,8 +158,13 @@ class report_log_table_log extends table_sql {
      * @return string HTML for the time column
      */
     public function col_time($event) {
-        $recenttimestr = get_string('strftimerecent', 'core_langconfig');
-        return userdate($event->timecreated, $recenttimestr);
+
+        if (empty($this->download)) {
+            $dateformat = get_string('strftimerecent', 'core_langconfig');
+        } else {
+            $dateformat = get_string('strftimedatetimeshort', 'core_langconfig');
+        }
+        return userdate($event->timecreated, $dateformat);
     }
 
     /**