Skip to content

Commit

Permalink
[4.1] Schedule Tasks notification dates
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
brianteeman committed Apr 15, 2022
1 parent 939488f commit 36dc0ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/system/tasknotification/tasknotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit 36dc0ff

Please sign in to comment.