Merge branch 'MDL-45452-course_completion_excel_dates' of https://github.com/leonstr/moodle

This commit is contained in:
Sara Arjona 2023-07-31 12:47:46 +02:00
commit d7dfae00a2
No known key found for this signature in database

View File

@ -56,6 +56,11 @@ $PAGE->set_pagelayout('report');
$firstnamesort = ($sort == 'firstname');
$excel = ($format == 'excelcsv');
$csv = ($format == 'csv' || $excel);
if ($csv) {
$dateformat = "%F %T";
} else {
$dateformat = get_string('strftimedatetimeshort', 'langconfig');
}
// Load CSV library
if ($csv) {
@ -592,7 +597,7 @@ foreach ($progress as $user) {
$state = COMPLETION_INCOMPLETE;
}
if ($is_complete) {
$date = userdate($criteria_completion->timecompleted, get_string('strftimedatetimeshort', 'langconfig'));
$date = userdate($criteria_completion->timecompleted, $dateformat);
} else {
$date = '';
}
@ -640,7 +645,7 @@ foreach ($progress as $user) {
$a->state = $describe;
if ($is_complete) {
$a->date = userdate($criteria_completion->timecompleted, get_string('strftimedatetimeshort', 'langconfig'));
$a->date = userdate($criteria_completion->timecompleted, $dateformat);
} else {
$a->date = '';
}
@ -694,7 +699,7 @@ foreach ($progress as $user) {
$a = new StdClass;
if ($ccompletion->is_complete()) {
$a->date = userdate($ccompletion->timecompleted, get_string('strftimedatetimeshort', 'langconfig'));
$a->date = userdate($ccompletion->timecompleted, $dateformat);
} else {
$a->date = '';
}