Skip to content

A free open source IT asset/license management system

CSV Import: License importer stores 1970-01-01 for unparseable expiration & termination dates

TowyTowyf7a9196062b1
diff --git a/app/Importer/LicenseImporter.php b/app/Importer/LicenseImporter.php
index d637d9084e..0d7639fd85 100644
--- a/app/Importer/LicenseImporter.php
+++ b/app/Importer/LicenseImporter.php
@@ -58,7 +58,8 @@ class LicenseImporter extends ItemImporter
$this->item['expiration_date'] = null;
if ($this->findCsvMatch($row, 'expiration_date') != '') {
- $this->item['expiration_date'] = date('Y-m-d 00:00:01', strtotime(trim($this->findCsvMatch($row, 'expiration_date'))));
+ $this->item['expiration_date'] = $this->findCsvMatch($row, 'expiration_date');
+ $this->item['expiration_date'] = $this->parseOrNullDate('expiration_date');
}
$this->item['license_email'] = trim($this->findCsvMatch($row, 'license_email'));
$this->item['license_name'] = trim($this->findCsvMatch($row, 'license_name'));
@@ -76,7 +77,8 @@ class LicenseImporter extends ItemImporter
$this->item['termination_date'] = null;
if ($this->findCsvMatch($row, 'termination_date') != '') {
- $this->item['termination_date'] = date('Y-m-d 00:00:01', strtotime($this->findCsvMatch($row, 'termination_date')));
+ $this->item['termination_date'] = $this->findCsvMatch($row, 'termination_date');
+ $this->item['termination_date'] = $this->parseOrNullDate('termination_date');
}
if ($editingLicense) {