Skip to content

Commit

Permalink
MDL-31636 Added strftimeformat to comment object being passed through…
Browse files Browse the repository at this point in the history
… to xxx_comment_display() for further time format changes.
  • Loading branch information
Aparup Banerjee authored and Damyon Wiese committed Feb 19, 2013
1 parent 6c847bb commit 6b969e1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion comment/lib.php
Expand Up @@ -526,6 +526,7 @@ public function get_comments($page = '') {
$c->content = $u->ccontent; $c->content = $u->ccontent;
$c->format = $u->cformat; $c->format = $u->cformat;
$c->timecreated = $u->ctimecreated; $c->timecreated = $u->ctimecreated;
$c->strftimeformat = get_string('strftimerecent', 'langconfig');
$url = new moodle_url('/user/view.php', array('id'=>$u->id, 'course'=>$this->courseid)); $url = new moodle_url('/user/view.php', array('id'=>$u->id, 'course'=>$this->courseid));
$c->profileurl = $url->out(false); $c->profileurl = $url->out(false);
$c->fullname = fullname($u); $c->fullname = fullname($u);
Expand Down Expand Up @@ -793,7 +794,7 @@ public function print_comment($cmt, $nonjs = true) {
$replacements[] = $cmt->avatar; $replacements[] = $cmt->avatar;
$replacements[] = html_writer::link($cmt->profileurl, $cmt->fullname); $replacements[] = html_writer::link($cmt->profileurl, $cmt->fullname);
$replacements[] = $cmt->content; $replacements[] = $cmt->content;
$replacements[] = userdate($cmt->timecreated, get_string('strftimerecent', 'langconfig')); $replacements[] = userdate($cmt->timecreated, $cmt->strftimeformat);


// use html template to format a single comment. // use html template to format a single comment.
return str_replace($patterns, $replacements, $this->template); return str_replace($patterns, $replacements, $this->template);
Expand Down

0 comments on commit 6b969e1

Please sign in to comment.