Skip to content

Commit 130a744

Browse files
committed
feature #61837 [Form] Add new active_at, not_active_at and legal_tender options to CurrencyType (Crovitche-1623)
This PR was squashed before being merged into the 7.4 branch. Discussion ---------- [Form] Add new `active_at`, `not_active_at` and `legal_tender` options to `CurrencyType` | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | yes | Deprecations? | no | Issues | - | License | MIT Add the options `active_at`, `not_active_at` and `legal_tender` from #61431 that give the possibility to filter the currencies more precisely. For instance: - Keep only the current ones for the given `active_at` (`today` by default) - Keep only the currencies that are [legal tender](https://en.wikipedia.org/wiki/Legal_tender) Regarding BC compatibility, if people want to have the same results as prior 7.4, they should set the `active_at` and `legal_tender` options to null explicitely. Commits ------- a378fe6c58a [Form] Add new `active_at`, `not_active_at` and `legal_tender` options to `CurrencyType`
2 parents 8c4c3f4 + 7fb424e commit 130a744

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Currencies.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,10 @@ private static function isDateActive(string $country, string $currency, array $c
225225
throw new \RuntimeException("Cannot check whether the currency $currency is active or not in $country because they are no validity dates available.");
226226
}
227227

228-
$from = \DateTimeImmutable::createFromFormat('Y-m-d', $currencyMetadata['from']);
228+
$from = \DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s', $currencyMetadata['from'], new \DateTimeZone('Etc/UTC'));
229229

230230
if (\array_key_exists('to', $currencyMetadata)) {
231-
$to = \DateTimeImmutable::createFromFormat('Y-m-d', $currencyMetadata['to']);
231+
$to = \DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s', $currencyMetadata['to'], new \DateTimeZone('Etc/UTC'));
232232
} else {
233233
$to = null;
234234
}

0 commit comments

Comments
 (0)