Skip to content

Commit

Permalink
MDL-67467 Reports: sortable date format in pregress csv report
Browse files Browse the repository at this point in the history
date format in csv report should be sortable by date.
  • Loading branch information
John Yao committed Dec 23, 2019
1 parent 7850f76 commit 9514c1a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion report/progress/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,11 @@ function csv_quote($value) {
$datepassedclass = $datepassed ? 'completion-expired' : '';

if ($activity->completionexpected) {
$datetext=userdate($activity->completionexpected,get_string('strftimedate','langconfig'));
if ($csv) {
$datetext = userdate($activity->completionexpected, "%F %T");
} else {
$datetext = userdate($activity->completionexpected, get_string('strftimedate', 'langconfig'));
}
} else {
$datetext='';
}
Expand Down Expand Up @@ -415,6 +419,9 @@ function csv_quote($value) {
$fulldescribe=get_string('progress-title','completion',$a);

if ($csv) {
if ($date != '') {
$date = userdate($thisprogress->timemodified, "%F %T");
}
print $sep.csv_quote($describe).$sep.csv_quote($date);
} else {
$celltext = $OUTPUT->pix_icon('i/' . $completionicon, s($fulldescribe));
Expand Down

0 comments on commit 9514c1a

Please sign in to comment.