2 Commits
1.0 ... 1.0.2

Author SHA1 Message Date
5cb5ac839d table params fix 2024-08-29 12:07:54 +03:00
cf2cada74e fix date format 2024-08-29 11:49:46 +03:00
3 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,8 @@
<?php <?php
ini_set("display_errors", true);
error_reporting(-1);
require_once "../vendor/autoload.php"; require_once "../vendor/autoload.php";
use Itguild\Tables\Filter\InputDateFilter; use Itguild\Tables\Filter\InputDateFilter;

View File

@ -229,7 +229,7 @@ class ListJsonTable extends JasonTable
} }
} }
} }
if (is_array($this->beforePrintCell[$filter])) { if (isset($this->beforePrintCell[$filter]) and is_array($this->beforePrintCell[$filter])) {
if (isset($this->beforePrintCell[$filter]['filter'])) { if (isset($this->beforePrintCell[$filter]['filter'])) {
return true; return true;
} }
@ -268,9 +268,9 @@ class ListJsonTable extends JasonTable
if ($this->issetFilter($key)){ if ($this->issetFilter($key)){
$filter = $this->getCurrentFilter($key); $filter = $this->getCurrentFilter($key);
$class = new $filter['class']([ $class = new $filter['class']([
'param' => $filter['param'], 'param' => $filter['param'] ?? '',
'name' => $key, 'name' => $key,
'value' => $filter['value'] 'value' => $filter['value'] ?? '',
]); ]);
$this->html .= $class->fetch(); $this->html .= $class->fetch();
} }

View File

@ -12,6 +12,6 @@ class DateFormat extends BaseFormat
*/ */
static function fetch(?string $data, string $options = ""): ?string static function fetch(?string $data, string $options = ""): ?string
{ {
return (new DateTimeImmutable($data))->format($options) ?? null; return (new DateTimeImmutable($data ?? ""))->format($options) ?? null;
} }
} }