Skip to content

Commit

Permalink
Skip empty fields during field formating.
Browse files Browse the repository at this point in the history
  • Loading branch information
tertek committed Jun 20, 2022
1 parent f83488f commit 0dc9e50
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions recordHomeDashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ private function getInstancesData( $project_id , $record, $instrument, $fields=n
foreach ($filtered as $key => $instance) {
// Adjust formatting (dates)
foreach ($array_to_format as $field_to_format => $valtype) {
// Skip empty fields otherwise it will be filled with invalid data
if(empty($instance[$field_to_format])) {
continue;
}
$instance[$field_to_format] = $formatter::renderDateFormat($instance[$field_to_format], $valtype);
}

Expand Down

0 comments on commit 0dc9e50

Please sign in to comment.