Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Apple-Mobile][Globalization] Refactoring of CalendarData.iOS and new DateTimeFormatInfo* tests #102464

Merged
merged 19 commits into from
Jul 12, 2024

Conversation

matouskozak
Copy link
Member

@matouskozak matouskozak commented May 20, 2024

Description

This PR has 3 components:

1. Refactoring of CalendarData.iOS.cs

The goal was to unify logic with CalendarData.ICU. Eventually it should be possible to fully merge these two together.

2. Fix of DateTimeFormatInfo.LongDatePattern API:

The previously returned format was incorrect. Previously we were returning the NSDateFormatterLongStyle. However, for .NET the LongDatePattern (https://learn.microsoft.com/en-us/dotnet/api/system.globalization.datetimeformatinfo.longdatepattern?view=net-8.0) corresponds to NSDateFormatterFullStyle (https://developer.apple.com/documentation/foundation/nsdateformatterstyle/nsdateformatterfullstyle).

3. Adding new test cases for DateTimeFormatInfo* APIs

Many of DateTimeFormatInfo* APIs were only tested in InvartianGlobalization settings before. The following tests were added for platforms with ICU globalization:

  • DateTimeFormatInfoAbbreviatedDayNames (en-US, fr-FR)
  • DateTimeFormatInfoAbbreviatedMonthGenitiveNames (en-US, fr-FR)
  • DateTimeFormatInfoAbbreviatedMonthNames (en-US, fr-FR)
  • DateTimeFormatInfoDayNames (en-US, fr-FR)
  • DateTimeFormatInfoLongDatePattern (en-US, fr-FR)
  • DateTimeFormatInfoMonthDayPattern (en-US, fr-FR)
  • DateTimeFormatInfoMonthGenitiveNames (en-US, fr-FR)
  • DateTimeFormatInfoMonthNames (en-US, fr-FR)

The en-US, fr-FR locales were selected because they are generally the most stable between ICU versions.


Contributes to #100240

@matouskozak matouskozak added NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) NO-REVIEW Experimental/testing PR, do NOT review it area-System.Globalization os-ios Apple iOS os-tvos Apple tvOS os-maccatalyst MacCatalyst OS labels May 20, 2024
@matouskozak matouskozak self-assigned this May 20, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-globalization
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it.

@matouskozak matouskozak reopened this Jun 19, 2024
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@matouskozak matouskozak changed the title [WIP][Apple-Mobile][HybridGlobalization] Fix DatePattern formats + add new tests [Apple-Mobile][Globalization] Refactoring of CalendarData.iOS and new DateTimeFormatInfo* tests Jul 8, 2024
@matouskozak matouskozak removed NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) NO-REVIEW Experimental/testing PR, do NOT review it labels Jul 8, 2024
@matouskozak matouskozak marked this pull request as ready for review July 8, 2024 08:39
@matouskozak matouskozak added this to the 9.0.0 milestone Jul 8, 2024
Copy link
Contributor

@mkhamoyan mkhamoyan left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for cleaning it up!

Copy link
Member

@tarekgh tarekgh left a comment

Choose a reason for hiding this comment

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

I have added minor comments. Please ensure to apply that on all added tests. LGTM otherwise.

@matouskozak
Copy link
Member Author

/azp run runtime-extra-platforms

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@matouskozak
Copy link
Member Author

The extra-platform failures are known and are tracked at: #103472. The System.Net.NameResolution.Functional.Tests failures were infrastructure related and seem to be resolved on the latest rolling builds.

@matouskozak matouskozak merged commit 42b2b19 into dotnet:main Jul 12, 2024
183 of 202 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 11, 2024
@matouskozak matouskozak deleted the apple-hybrid/date-patterns-fix branch October 3, 2024 13:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants