Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Form] Add newactive_at,not_active_at andlegal_tender options toCurrencyType#61837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@Crovitche-1623
Copy link
Contributor

@Crovitche-1623Crovitche-1623 commentedSep 24, 2025
edited
Loading

QA
Branch?7.4
Bug fix?no
New feature?yes
Deprecations?no
Issues-
LicenseMIT

Add the optionsactive_at,not_active_at andlegal_tender from#61431 that give the possibility to filter the currencies more precisely. For instance:

  • Keep only the current ones for the givenactive_at (today by default)
  • Keep only the currencies that arelegal tender

Regarding BC compatibility, if people want to have the same results as prior 7.4, they should set theactive_at andlegal_tender options to null explicitely.

@Crovitche-1623
Copy link
ContributorAuthor

Is it necessary to add more tests given that the filtering methodisValidInAnyCountry has already been tested in the Intl component ?

@symfonysymfony deleted a comment fromcarsonbotSep 25, 2025
@Crovitche-1623Crovitche-1623 changed the title[Form] Add newactive,legal_tender anddate options toCurrencyType[Form] Add newactive,legal_tender andactive_or_not_at options toCurrencyTypeSep 25, 2025
@ro0NL
Copy link
Contributor

should we force the new defaults in a deprecated manner?

@Crovitche-1623
Copy link
ContributorAuthor

should we force the new defaults in a deprecated manner?

@ro0NL
We could using an additional option that the developer had to toggle to explicitely specify to disable the deprecation but IMHO, I'm not even sure that most people use obsolete currencies nowadays. This BC will affect 1% or less. The choice is yours...

@nicolas-grekas
Copy link
Member

I don't understand why we need active and active_or_not_at? That's to cover the need of listing only non-active currencies at a given date? Is that a common enough usecase?

@Crovitche-1623
Copy link
ContributorAuthor

Crovitche-1623 commentedSep 26, 2025
edited
Loading

I don't understand why we need active and active_or_not_at? That's to cover the need of listing only non-active currencies at a given date? Is that a common enough usecase?

IMHO yes it could be a common use case to list only the non-active currencies for a given date, for the following reasons:

  1. For example, if your app needs to search invoices that were issued with the wrong currencies and show a dropdown of those invalid currencies, you would still need two parameters (active = false andactive_or_not_at = the previous year).
  2. We have no guarantee that certains symfony applications will be updated within 4 years (the duration of an LTS version). Therefore, the CLDR registry will not necessarily be updated during this period if symfony is not updated. Over this time, currency validity may change, and interfaces (with form usingCurrencyType) may be created to retroactively correct ‘incorrect’ currencies.

WDYT@nicolas-grekas ?

@Crovitche-1623Crovitche-1623 changed the title[Form] Add newactive,legal_tender andactive_or_not_at options toCurrencyType[Form] Add newactive_at,active_or_not_at andlegal_tender options toCurrencyTypeSep 26, 2025
@Crovitche-1623Crovitche-1623 changed the title[Form] Add newactive_at,active_or_not_at andlegal_tender options toCurrencyType[Form] Add newactive_at,not_active_at andlegal_tender options toCurrencyTypeSep 26, 2025
@Crovitche-1623
Copy link
ContributorAuthor

@nicolas-grekas A part from that I think I forgot to process the eventualtz andto-tz attributes from the CLDR. I don't know if it'll change the generated data though but I'll try to fix this point ASAP. seehttps://github.com/unicode-org/cldr/blob/2cac2a547276f5253e0556dc3fb0b8c77e46ab40/common/supplemental/supplementalData.xml#L369-L370

@nicolas-grekas
Copy link
Member

If we want to account for the TZ, maybe we should put timestamps in the metadata instead of date strings? (if that's what we have right now)

@Crovitche-1623
Copy link
ContributorAuthor

Crovitche-1623 commentedSep 26, 2025
edited
Loading

If we want to account for the TZ, maybe we should put timestamps in the metadata instead of date strings? (if that's what we have right now)

Yes, or we could convert thefrom andto directly into UTC during the processing to see if theY-m-d date changes. However, we would lose the time at which the change took place... This is a very specific case. Which solution do you prefer?

@nicolas-grekas
Copy link
Member

it might be more readable to have Y-m-d H:i:s UTC strings indeed

@Crovitche-1623
Copy link
ContributorAuthor

Crovitche-1623 commentedSep 26, 2025
edited
Loading

it might be more readable to have Y-m-d H:i:s UTC strings indeed

Ok 👍🏻 Do I create another PR for this or can I do the required changes in the current one ?

@nicolas-grekas
Copy link
Member

nicolas-grekas commentedSep 26, 2025
edited
Loading

It should be a separate PR targetting branch 6.4

Crovitche-1623 reacted with thumbs up emoji

@Crovitche-1623
Copy link
ContributorAuthor

Crovitche-1623 commentedSep 26, 2025
edited
Loading

I will change the format to retrieve time once#61859 is merged. 👍🏻 Done, the tests will pass once#61859 will be merged.

returnarray_flip($filteredCurrencyNames);
},
),
$choiceTranslationLocale.($activeAt ??$notActiveAt)?->format('Y-m-d\TH:i:s').$legalTenderCacheKey,
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Note: Some timezones use unusual offsets, with the smallest official step being 15 minutes. I used the seconds as the smallest units but we could use only minutes if we wanted to.

fabpot added a commit that referenced this pull requestOct 1, 2025
…dity (Crovitche-1623)This PR was squashed before being merged into the 6.4 branch.Discussion----------[Intl] Support time in generated data in currencies validity| Q             | A| ------------- | ---| Branch?       | 6.4| Bug fix?      | no| New feature?  | yes| Deprecations? | no| Issues        | -| License       | MIT`@nicolas`-grekassee#61837 (comment)Note: This PR is a prerequisite of#61837Commits-------ed53287 [Intl] Support time in generated data in currencies validity
@fabpotfabpotforce-pushed thecurrency-type-with-active-currencies branch fromdcf0f08 toa378fe6CompareOctober 1, 2025 06:11
@fabpot
Copy link
Member

Thank you@Crovitche-1623.

Crovitche-1623 reacted with hooray emojiCrovitche-1623 reacted with heart emoji

@fabpotfabpot merged commitc8e4bf8 intosymfony:7.4Oct 1, 2025
11 of 13 checks passed
nicolas-grekas added a commit that referenced this pull requestOct 2, 2025
This PR was merged into the 7.4 branch.Discussion----------[Form] do not install symfony/intl < 7.4| Q             | A| ------------- | ---| Branch?       | 7.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        || License       | MITthe changes done in#61837 require#61431Commits-------badf463 do not install symfony/intl < 7.4
This was referencedOct 27, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz left review comments

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@fabpotfabpotfabpot approved these changes

@xabbuhxabbuhAwaiting requested review from xabbuhxabbuh is a code owner

@ycerutoycerutoAwaiting requested review from ycerutoyceruto is a code owner

@stofstofAwaiting requested review from stof

Assignees

No one assigned

Projects

None yet

Milestone

7.4

Development

Successfully merging this pull request may close these issues.

7 participants

@Crovitche-1623@ro0NL@nicolas-grekas@fabpot@javiereguiluz@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp