From 7f76a2b62612cb121c18c2ec475c6ea22ea2559e Mon Sep 17 00:00:00 2001 From: ferran Date: Mon, 14 Apr 2025 11:15:48 +0200 Subject: [PATCH] MDL-84641 mod_workshop: add human date to overview --- mod/workshop/classes/courseformat/overview.php | 3 ++- mod/workshop/tests/behat/overview_report.feature | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mod/workshop/classes/courseformat/overview.php b/mod/workshop/classes/courseformat/overview.php index 29378bd074e..3e01769787a 100644 --- a/mod/workshop/classes/courseformat/overview.php +++ b/mod/workshop/classes/courseformat/overview.php @@ -17,6 +17,7 @@ namespace mod_workshop\courseformat; use cm_info; +use core_calendar\output\humandate; use core_courseformat\local\overview\overviewitem; use core\output\action_link; use core\output\local\properties\text_align; @@ -130,7 +131,7 @@ class overview extends \core_courseformat\activityoverviewbase { return new overviewitem( name: get_string('deadline', 'workshop'), value: (int) $deadline, - content: userdate($deadline), + content: humandate::create_from_timestamp($deadline), ); } diff --git a/mod/workshop/tests/behat/overview_report.feature b/mod/workshop/tests/behat/overview_report.feature index efdf7163ac4..d1a107f7d3e 100644 --- a/mod/workshop/tests/behat/overview_report.feature +++ b/mod/workshop/tests/behat/overview_report.feature @@ -31,9 +31,9 @@ In order to summarize the workshops | student8 | C1 | student | | teacher1 | C1 | editingteacher | And the following "activities" exist: - | activity | name | course | idnumber | submissiontypetext | submissiontypefile | grade | gradinggrade | gradedecimals | overallfeedbackmethod |latesubmissions | submisstionstart | submissionend | - | workshop | Activity 1 | C1 | workshop1 | 2 | 1 | 100 | 5 | 1 | 2 |1 | ##1 Jan 2018 08:00## | ##1 Jan 2040 08:00## | - | workshop | Activity 2 | C1 | workshop1 | 2 | 1 | 100 | 5 | 1 | 2 |1 | ##1 Jan 2018 08:00## | ##1 Jan 2040 08:00## | + | activity | name | course | idnumber | submissiontypetext | submissiontypefile | grade | gradinggrade | gradedecimals | overallfeedbackmethod | latesubmissions | submisstionstart | submissionend | + | workshop | Activity 1 | C1 | workshop1 | 2 | 1 | 100 | 5 | 1 | 2 | 1 | ##1 Jan 2018 08:00## | ##1 Jan 2040 08:00## | + | workshop | Activity 2 | C1 | workshop1 | 2 | 1 | 100 | 5 | 1 | 2 | 1 | ##today noon## | ##tomorrow noon## | Scenario: The workshop overview report should generate log events Given I am on the "Course 1" "course > activities > workshop" page logged in as "teacher1" @@ -145,7 +145,7 @@ In order to summarize the workshops And I should see "Submission phase" in the "Activity 2" "table_row" # Cheack Deadline. And I should see "-" in the "Activity 1" "table_row" - And I should see "1 January 2040" in the "Activity 2" "table_row" + And I should see "Tomorrow" in the "Activity 2" "table_row" # Check Submissions. And I should see "1 of 8" in the "Activity 1" "table_row" And I should see "0 of 8" in the "Activity 2" "table_row"