validasi tanggal

This commit is contained in:
2024-01-16 16:48:57 +07:00
parent 9169c06897
commit 12ef4c167f

View File

@@ -106,7 +106,11 @@ class RequestLogService
if ($date_from_row instanceof DateTime) {
return $date_from_row->format('Y-m-d');
} else if ($date_from_row != null) {
return date('Y-m-d', strtotime($date_from_row));
if (strtotime($date_from_row)){
return date('Y-m-d', strtotime($date_from_row));
} else {
return null;
}
} else {
return null;
}
@@ -138,6 +142,12 @@ class RequestLogService
'member_id' => $row['member_id'],
]), 0, null, $row);
}
$dateSubmission = $this->dateParser($row['submission_date']);
if (!$dateSubmission){
throw new ImportRowException(__('Format Date Invalid'), 0, null, $row);
}
// Membuat singkatan dari nama rumah sakit
$singkatan = "";
$words = explode(' ', $row['organization_id']);