From 84e9516d203a5dd9e0f6653b130aebd75988a14f Mon Sep 17 00:00:00 2001 From: inajaf Date: Thu, 16 Feb 2023 17:40:39 +0400 Subject: [PATCH] Fix strtotime null values issue --- view/adminhtml/templates/reports.phtml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/view/adminhtml/templates/reports.phtml b/view/adminhtml/templates/reports.phtml index dc883d0..16b9340 100644 --- a/view/adminhtml/templates/reports.phtml +++ b/view/adminhtml/templates/reports.phtml @@ -49,9 +49,11 @@ $executed = $job["executed_at"]; $runtime = ''; } else { - $executed = strtotime((string)$job["executed_at"]); - $executed = date("Y-m-d h:i:s A",($executed - $timediff)); - $runtime = strtotime((string)$job["finished_at"]) - strtotime((string)$job["executed_at"]) .'s'; + $executed = strtotime((string) $job["executed_at"]) ?? ''; + $executed = $executed ? date("Y-m-d h:i:s A",($executed - $timediff)) : ''; + $finished = strtotime((string) $job["finished_at"]) ?? ''; + $runtime = ($finished !== '' && $executed !== '') ? + strtotime($job["finished_at"]) - strtotime($job["executed_at"]) . 's' : ''; } //print_r($job); print '';