Fixed variable name, $field

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-06-05 10:10:57 +01:00
parent 181bafd012
commit b0ddb26e73

View file

@ -565,7 +565,7 @@ abstract class Importer
*/ */
public function parseOrNullDate($field, $format = 'date') { public function parseOrNullDate($field, $format = 'date') {
$format = 'Y-m-d'; $date_format = 'Y-m-d';
if ($format == 'datetime') { if ($format == 'datetime') {
$date_format = 'Y-m-d H:i:s'; $date_format = 'Y-m-d H:i:s';
@ -577,7 +577,7 @@ abstract class Importer
$value = CarbonImmutable::parse($this->item[$field])->format($date_format); $value = CarbonImmutable::parse($this->item[$field])->format($date_format);
return $value; return $value;
} catch (\Exception $e) { } catch (\Exception $e) {
$this->log('Unable to parse date: ' . $this->item['next_audit_date']); $this->log('Unable to parse date: ' . $this->item[$field]);
return null; return null;
} }
} }