Skip to content

Commit

Permalink
Return empty string on zero dates. (#2494)
Browse files Browse the repository at this point in the history
  • Loading branch information
kporras07 authored Sep 5, 2023
1 parent 3c7dd0c commit b96e422
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Commands/StructuredListTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ private function addDatetimeRenderer(AbstractStructuredList $list, array $date_a
$list->addRendererFunction(
function ($key, $cell_data) use ($config, $date_attributes) {
if (!is_numeric($key) && in_array($key, $date_attributes)) {
if (empty($cell_data)) {
return '-';
}
return $config->formatDatetime($cell_data);
}
return $cell_data;
Expand Down

0 comments on commit b96e422

Please sign in to comment.