diff --git a/index.php b/index.php index 839f63c..d07c51d 100644 --- a/index.php +++ b/index.php @@ -52,6 +52,13 @@ try { return null; } + return (new DateTimeImmutable($data))->format("d-m-Y"); + }, + 'updated_at' => function ($data) { + if (!$data){ + return null; + } + return (new DateTimeImmutable($data))->format("d-m-Y"); } ]); @@ -66,6 +73,22 @@ try { 'params' => ["class" => "table table-bordered", "border" => "2"], 'baseUrl' => "/admin/user", ])); + $table->rows([ + 'created_at' => function ($data) { + if (!$data){ + return null; + } + + return (new DateTimeImmutable($data))->format("d-m-Y"); + }, + 'updated_at' => function ($data) { + if (!$data){ + return null; + } + + return (new DateTimeImmutable($data))->format("d-m-Y"); + } + ]); $table->create(); $table->render(); } catch (Exception $e) { diff --git a/view.php b/view.php index 6267b38..6f801c7 100644 --- a/view.php +++ b/view.php @@ -38,6 +38,22 @@ try { 'params' => ["class" => "table table-bordered", "border" => "2"], 'baseUrl' => "/admin/user", ])); + $table->rows([ + 'created_at' => function ($data) { + if (!$data){ + return null; + } + + return (new DateTimeImmutable($data))->format("d-m-Y"); + }, + 'updated_at' => function ($data) { + if (!$data){ + return null; + } + + return (new DateTimeImmutable($data))->format("d-m-Y"); + } + ]); $table->create(); $table->render(); } catch (Exception $e) {