From 36dc0ff5ffaecf9e57d0c935bcbd45f1187c2251 Mon Sep 17 00:00:00 2001 From: brian teeman Date: Fri, 15 Apr 2022 10:10:19 +0100 Subject: [PATCH] [4.1] Schedule Tasks notification dates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change to use DATE_FORMAT_LC instead of RFC822 to enable translated dates in the notification emails. To test make sure that your test site will send emails Create a scheduled task and set the notification for task success to enabled Install russian language and set to default for admin Go to the list of scheduled tasks and perform a test run of the scheduled task. ### Before PR The email will look similar to > Задача #3, checking images, успешно выполнена Fri, 15 Apr 2022 08:54:34 +0000. ### After PR The email will look similar to > Задача #3, checking images, успешно выполнена Пятница, 15 апреля 2022, 09:09. --- plugins/system/tasknotification/tasknotification.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/system/tasknotification/tasknotification.php b/plugins/system/tasknotification/tasknotification.php index 8be57ffd4faaf..2d4f57354cbee 100644 --- a/plugins/system/tasknotification/tasknotification.php +++ b/plugins/system/tasknotification/tasknotification.php @@ -242,7 +242,7 @@ public function notifyFatalRecovery(Event $event): void */ private function getDataFromTask(Task $task): array { - $lockOrExecTime = Factory::getDate($task->get('locked') ?? $task->get('last_execution'))->toRFC822(); + $lockOrExecTime = Factory::getDate($task->get('locked') ?? $task->get('last_execution'))->format(Text::_('DATE_FORMAT_LC2')); return [ 'TASK_ID' => $task->get('id'),