Skip to content

Commit 9eccaaa

Browse files
committed
Merge branch '6.4' into 7.3
* 6.4: [Intl] Support time in generated data in currencies validity [Validator] Improve and complete Japanese translations [Validator] Fix Polish translation for word count validation message [Validator] Review and fix Czech translation
2 parents e6db848 + ccc5282 commit 9eccaaa

File tree

2 files changed

+698
-697
lines changed

2 files changed

+698
-697
lines changed

Data/Generator/CurrencyDataGenerator.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ private function generateCurrencyMap(mixed $supplementalDataBundle): array
165165
}
166166

167167
if (\array_key_exists('from', $metadata)) {
168-
$metadata['from'] = self::icuPairToDate($metadata['from']);
168+
$metadata['from'] = self::icuPairToDatetimeString($metadata['from']);
169169
}
170170

171171
if (\array_key_exists('to', $metadata)) {
172-
$metadata['to'] = self::icuPairToDate($metadata['to']);
172+
$metadata['to'] = self::icuPairToDatetimeString($metadata['to']);
173173
}
174174

175175
if (\array_key_exists('tender', $metadata)) {
@@ -225,7 +225,7 @@ private function generateNumericToAlpha3Mapping(array $alpha3ToNumericMapping):
225225
*
226226
* @param array{0: int, 1: int} $pair
227227
*/
228-
private static function icuPairToDate(array $pair): string
228+
private static function icuPairToDatetimeString(array $pair): string
229229
{
230230
[$highBits32, $lowBits32] = $pair;
231231

@@ -241,12 +241,13 @@ private static function icuPairToDate(array $pair): string
241241
--$seconds;
242242
}
243243

244-
$datetime = \DateTimeImmutable::createFromFormat('U', $seconds, new \DateTimeZone('Etc/UTC'));
244+
// Note: Unlike the XML files, the date pair is already in UTC.
245+
$datetime = \DateTimeImmutable::createFromFormat('U', (string) $seconds, new \DateTimeZone('Etc/UTC'));
245246

246247
if (false === $datetime) {
247248
throw new \RuntimeException('Unable to parse ICU milliseconds pair.');
248249
}
249250

250-
return $datetime->format('Y-m-d');
251+
return $datetime->format('Y-m-d\TH:i:s');
251252
}
252253
}

0 commit comments

Comments
 (0)