diff --git a/mod/forum/classes/local/exporters/post.php b/mod/forum/classes/local/exporters/post.php index 8faf0f90046..a1919f62939 100644 --- a/mod/forum/classes/local/exporters/post.php +++ b/mod/forum/classes/local/exporters/post.php @@ -638,9 +638,8 @@ class post extends exporter { private function get_author_subheading_html(stdClass $exportedauthor, int $timecreated) : string { $fullname = $exportedauthor->fullname; $profileurl = $exportedauthor->urls['profile'] ?? null; - $formatteddate = userdate($timecreated, get_string('strftimedaydatetime', 'core_langconfig')); $name = $profileurl ? "{$fullname}" : $fullname; - $date = ""; + $date = userdate_htmltime($timecreated, get_string('strftimedaydatetime', 'core_langconfig')); return get_string('bynameondate', 'mod_forum', ['name' => $name, 'date' => $date]); } } diff --git a/mod/forum/templates/forum_discussion_post.mustache b/mod/forum/templates/forum_discussion_post.mustache index f97101c90f3..868c1e8c9de 100644 --- a/mod/forum/templates/forum_discussion_post.mustache +++ b/mod/forum/templates/forum_discussion_post.mustache @@ -79,9 +79,11 @@
{{#html.authorsubheading}}{{{.}}}{{/html.authorsubheading}} {{^html.authorsubheading}} - + {{< core/time_element }} + {{$elementid}}created-{{id}}-{{uniqid}}{{/elementid}} + {{$timestampval}}{{timecreated}}{{/timestampval}} + {{$userdateformatval}}{{#str}} strftimedaydatetime, core_langconfig {{/str}}{{/userdateformatval}} + {{/core/time_element}} {{/html.authorsubheading}}
{{/isdeleted}} diff --git a/mod/forum/tests/generator/lib.php b/mod/forum/tests/generator/lib.php index 303c1958a78..bb071a02477 100644 --- a/mod/forum/tests/generator/lib.php +++ b/mod/forum/tests/generator/lib.php @@ -371,9 +371,8 @@ class mod_forum_generator extends testing_module_generator { public function get_author_subheading_html(stdClass $exportedauthor, int $timecreated) : string { $fullname = $exportedauthor->fullname; $profileurl = $exportedauthor->urls['profile'] ?? null; - $formatteddate = userdate($timecreated, get_string('strftimedaydatetime', 'core_langconfig')); $name = $profileurl ? "{$fullname}" : $fullname; - $date = ""; + $date = userdate_htmltime($timecreated, get_string('strftimedaydatetime', 'core_langconfig')); return get_string('bynameondate', 'mod_forum', ['name' => $name, 'date' => $date]); } }