Import Claim Request

This commit is contained in:
2024-02-27 10:47:25 +07:00
parent 40fb595673
commit f043165b15
6 changed files with 148 additions and 119 deletions

View File

@@ -11,6 +11,7 @@ use Illuminate\Support\Facades\DB;
use App\Models\Member;
use App\Models\User;
use App\Models\Service;
use DateTime;
class Helper
{
@@ -426,4 +427,20 @@ class Helper
ini_set('memory_limit', '256M');
}
public static function dateParser($date_from_row) {
if ($date_from_row instanceof DateTime) {
return $date_from_row->format('Y-m-d');
} else if ($date_from_row != null) {
if (strtotime($date_from_row)){
return date('Y-m-d', strtotime($date_from_row));
} else {
// throw new ImportRowException(__('Format Date Invalid'), 0, null, $date_from_row);
return null;
}
} else {
// throw new ImportRowException(__('Format Date Invalid'), 0, null, $date_from_row);
return null;
}
}
}