From 4daf1789db3d33dbd41da61c55f71332cc1a245b Mon Sep 17 00:00:00 2001 From: mahdahar <89adham@gmail.com> Date: Thu, 16 Oct 2025 16:03:40 +0700 Subject: [PATCH] fix patient birthdate --- app/Helpers/utc_helper.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Helpers/utc_helper.php b/app/Helpers/utc_helper.php index 04012ef..3055a0b 100644 --- a/app/Helpers/utc_helper.php +++ b/app/Helpers/utc_helper.php @@ -8,6 +8,9 @@ if (!function_exists('convert_array_to_utc')) { if (is_array($value)) { $data[$key] = convert_array_to_utc($value); } elseif (is_string($value) && is_datetime_string($value)) { + if (preg_match('/^\d{4}-\d{2}-\d{2}$/', $value)) { + continue; + } try { $data[$key] = Time::parse($value)->setTimezone('UTC')->toDateTimeString(); } catch (\Exception $e) { @@ -35,6 +38,9 @@ if (!function_exists('convert_array_to_utc_iso')) { if (is_array($value)) { $data[$key] = convert_array_to_utc_iso($value); } elseif (is_string($value) && is_datetime_string($value)) { + if (preg_match('/^\d{4}-\d{2}-\d{2}$/', $value)) { + continue; + } try { $data[$key] = Time::parse($value, 'UTC')->format('Y-m-d\TH:i:s.v\Z'); } catch (\Exception $e) {