MDL-31636 Added strftimeformat to comment object being passed through to xxx_comment_...
authorAparup Banerjee <aparup@moodle.com>
Mon, 18 Feb 2013 08:43:15 +0000 (16:43 +0800)
committerDamyon Wiese <damyon@moodle.com>
Tue, 19 Feb 2013 03:35:56 +0000 (11:35 +0800)
comment/lib.php

index c146119..c423ef1 100644 (file)
@@ -526,6 +526,7 @@ class comment {
             $c->content     = $u->ccontent;
             $c->format      = $u->cformat;
             $c->timecreated = $u->ctimecreated;
+            $c->strftimeformat = get_string('strftimerecent', 'langconfig');
             $url = new moodle_url('/user/view.php', array('id'=>$u->id, 'course'=>$this->courseid));
             $c->profileurl = $url->out(false);
             $c->fullname = fullname($u);
@@ -793,7 +794,7 @@ class comment {
         $replacements[] = $cmt->avatar;
         $replacements[] = html_writer::link($cmt->profileurl, $cmt->fullname);
         $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.
         return str_replace($patterns, $replacements, $this->template);