view date fix

This commit is contained in:
Билай Станислав 2024-08-07 12:40:38 +03:00
parent 138c5149c1
commit 9bb53a1dc0
2 changed files with 39 additions and 0 deletions

View File

@ -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) {

View File

@ -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) {