GenericTable: better handling of null values for timestamps
This commit is contained in:
parent
219260c57f
commit
3dfda45681
@ -62,6 +62,7 @@ class ManageUsers extends HTMLController
|
|||||||
'type' => 'timestamp',
|
'type' => 'timestamp',
|
||||||
'pattern' => 'long',
|
'pattern' => 'long',
|
||||||
'value' => 'last_action_time',
|
'value' => 'last_action_time',
|
||||||
|
'if_null' => 'n/a',
|
||||||
],
|
],
|
||||||
'header' => 'Last activity',
|
'header' => 'Last activity',
|
||||||
'is_sortable' => true,
|
'is_sortable' => true,
|
||||||
|
@ -226,8 +226,8 @@ class GenericTable
|
|||||||
else
|
else
|
||||||
$pattern = $options['pattern'];
|
$pattern = $options['pattern'];
|
||||||
|
|
||||||
assert(isset($rowData[$options['value']]));
|
assert(array_key_exists($options['value'], $rowData));
|
||||||
if (!is_numeric($rowData[$options['value']]))
|
if (isset($rowData[$options['value']]) && !is_numeric($rowData[$options['value']]))
|
||||||
$timestamp = strtotime($rowData[$options['value']]);
|
$timestamp = strtotime($rowData[$options['value']]);
|
||||||
else
|
else
|
||||||
$timestamp = (int) $rowData[$options['value']];
|
$timestamp = (int) $rowData[$options['value']];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user