Pārlūkot izejas kodu

Fix accessor issue in friendly date

Vijayakrishnan Krishnan 5 gadi atpakaļ
vecāks
revīzija
543413c15a

+ 1 - 1
app/Console/Commands/GenerateTreeCommand.php

@@ -781,7 +781,7 @@ class GenController {
             $linkTarget = $method->exitURL;
 
             if(substr($column, -3) === '_at') {
-                $columnValue = "<?= friendly_date_time(\$record->$column) ?>";
+                $columnValue = "<?= friendly_date_time(\$subRecord->$column) ?>";
             }
 
             // check if this column has column spec

+ 1 - 0
app/Helpers/Helper.php

@@ -75,6 +75,7 @@ if (!function_exists('value_from_rs')) {
 
 if(!function_exists('friendly_date_time')) {
     function friendly_date_time($value) {
+        if(!$value || empty($value)) return "-";
         try {
             $result = strtotime($value);
             $result = date("j M o, H:i");