Normalize dates in TldRegistryService results

Updated the assignment of 'registration_date' and 'record_last_updated' fields to use the normalizeDate method, ensuring consistent date formatting in the TldRegistryService output.
This commit is contained in:
Hosteroid
2025-10-11 01:15:03 +03:00
parent b50377492c
commit b0b2b6a94d

View File

@@ -1430,10 +1430,10 @@ class TldRegistryService
if (isset($event['eventAction']) && isset($event['eventDate'])) { if (isset($event['eventAction']) && isset($event['eventDate'])) {
switch ($event['eventAction']) { switch ($event['eventAction']) {
case 'registration': case 'registration':
$result['registration_date'] = $event['eventDate']; $result['registration_date'] = $this->normalizeDate($event['eventDate']);
break; break;
case 'last changed': case 'last changed':
$result['record_last_updated'] = $event['eventDate']; $result['record_last_updated'] = $this->normalizeDate($event['eventDate']);
break; break;
} }
} }
@@ -1507,13 +1507,13 @@ class TldRegistryService
$result['whois_server'] = $whoisServer; $result['whois_server'] = $whoisServer;
} }
if ($lastUpdated) { if ($lastUpdated) {
$result['record_last_updated'] = $lastUpdated; $result['record_last_updated'] = $this->normalizeDate($lastUpdated);
} }
if ($registryUrl) { if ($registryUrl) {
$result['registry_url'] = $registryUrl; $result['registry_url'] = $registryUrl;
} }
if ($registrationDate) { if ($registrationDate) {
$result['registration_date'] = $registrationDate; $result['registration_date'] = $this->normalizeDate($registrationDate);
} }
return !empty($result) ? $result : null; return !empty($result) ? $result : null;