-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[browser][non-icu]
HybridGlobalization
calendar data (#89255)
* Calendar WIP. * Genitive months. * Short pattern. * NativeCalendarName does not exist on WebAPI - use EnglishCalendarName. * Fix failures in Locales caused by calendars data removal. * Fix to previous commit. * Whitespace. * Implemented Eras. * Populate NativeName with EnglishName. * Fix tests. * Typos + comments removal + block failing test. * AM/PM designators are not in ICU anymore. * ShortTimePattern is ready. * Fix some failing tests. * LongTimePatterns is ready. * Ask about all culture info from JS at once. * Fix remaining tests. * Calendar Globalization tests fixed. * Adding test files to projects. * Build fix. * Fix the fix. * . * Fix tests. * Load locale info on request + fix Browser scenario tests. * Fix test on v8. * Forgotten clean-up. * Small cleanup in ts. * V8 11 is behaves more like browser. * Fixed skipped failing tests. * Syntax * V8 returns the same as Browser. * This API is not affected, no need to test. + Add documentation. * Revert unintentional change. * Feedback. * @radical's feedback + fix after removing unnecessary set. * Fix. * Feedback. * Fix tests.
- Loading branch information
1 parent
6029c30
commit a9363bf
Showing
45 changed files
with
4,861 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/libraries/Common/src/Interop/Browser/Interop.Calendar.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Globalization; | ||
using System.Runtime.CompilerServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static unsafe partial class JsGlobalization | ||
{ | ||
[MethodImplAttribute(MethodImplOptions.InternalCall)] | ||
internal static extern unsafe int GetCalendarInfo(in string culture, CalendarId calendarId, char* buffer, int bufferLength, out int exceptionalResult, out object result); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/libraries/Common/src/Interop/Browser/Interop.Locale.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.CompilerServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static unsafe partial class JsGlobalization | ||
{ | ||
[MethodImplAttribute(MethodImplOptions.InternalCall)] | ||
internal static extern unsafe int GetCultureInfo(in string culture, char* buffer, int bufferLength, out int exceptionalResult, out object result); | ||
[MethodImplAttribute(MethodImplOptions.InternalCall)] | ||
internal static extern unsafe int GetFirstDayOfWeek(in string culture, out int exceptionalResult, out object result); | ||
[MethodImplAttribute(MethodImplOptions.InternalCall)] | ||
internal static extern unsafe int GetFirstWeekOfYear(in string culture, out int exceptionalResult, out object result); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
...balization.Calendars/tests/Hybrid/System.Globalization.Calendars.Hybrid.WASM.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFrameworks>$(NetCoreAppCurrent)-browser</TargetFrameworks> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
<TestRuntime>true</TestRuntime> | ||
<HybridGlobalization>true</HybridGlobalization> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="..\System\Globalization\CalendarTestBase.cs" /> | ||
<Compile Include="..\System\Globalization\ChineseLunisolarCalendarTests.cs" /> | ||
<Compile Include="..\System\Globalization\EastAsianLunisolarCalendarTestBase.cs" /> | ||
<Compile Include="..\System\Globalization\GregorianCalendarTests.cs" /> | ||
<Compile Include="..\System\Globalization\HebrewCalendarTests.cs" /> | ||
<Compile Include="..\System\Globalization\HijriCalendarTests.cs" /> | ||
<Compile Include="..\System\Globalization\JapaneseCalendarTests.cs" /> | ||
<Compile Include="..\System\Globalization\JapaneseLunisolarCalendarTests.cs" /> | ||
<Compile Include="..\System\Globalization\JulianCalendarTests.cs" /> | ||
<Compile Include="..\System\Globalization\KoreanCalendarTests.cs" /> | ||
<Compile Include="..\System\Globalization\KoreanLunisolarCalendarTests.cs" /> | ||
<Compile Include="..\System\Globalization\PersianCalendarTests.cs" /> | ||
<Compile Include="..\System\Globalization\TaiwanCalendarTests.cs" /> | ||
<Compile Include="..\System\Globalization\TaiwanLunisolarCalendarTests.cs" /> | ||
<Compile Include="..\System\Globalization\ThaiBuddhistCalendarTests.cs" /> | ||
<Compile Include="..\System\Globalization\UmAlQuraCalendarTests.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarAddMonths.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarAddYears.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarGetDayOfMonth.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarGetDayOfWeek.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarGetDayOfYear.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarGetDaysInMonth.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarGetDaysInYear.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarGetEra.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarGetMonth.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarGetLeapMonth.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarGetMonthsInYear.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarGetWeekOfYear.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarGetYear.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarIsLeapDay.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarIsLeapMonth.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarIsLeapYear.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarTests.Utilities.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarToDateTime.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarToFourDigitYear.cs" /> | ||
<Compile Include="..\GregorianCalendar\GregorianCalendarTwoDigitYearMax.cs" /> | ||
<Compile Include="..\ISOWeek\ISOWeekTests.cs" /> | ||
<Compile Include="..\JapaneseCalendar\JapaneseCalendarAddMonths.cs" /> | ||
<Compile Include="..\JapaneseCalendar\JapaneseCalendarToFourDigitYear.cs" /> | ||
<Compile Include="..\JapaneseCalendar\JapaneseCalendarTwoDigitYearMax.cs" /> | ||
<Compile Include="..\KoreanCalendar\KoreanCalendarToDateTime.cs" /> | ||
<Compile Include="..\KoreanCalendar\KoreanCalendarAddMonths.cs" /> | ||
<Compile Include="..\KoreanCalendar\KoreanCalendarAddYears.cs" /> | ||
<Compile Include="..\KoreanCalendar\KoreanCalendarGetDayOfMonth.cs" /> | ||
<Compile Include="..\KoreanCalendar\KoreanCalendarGetDayOfWeek.cs" /> | ||
<Compile Include="..\KoreanCalendar\KoreanCalendarGetDayOfYear.cs" /> | ||
<Compile Include="..\KoreanCalendar\KoreanCalendarGetDaysInMonth.cs" /> | ||
<Compile Include="..\KoreanCalendar\KoreanCalendarGetDaysInYear.cs" /> | ||
<Compile Include="..\KoreanCalendar\KoreanCalendarGetEra.cs" /> | ||
<Compile Include="..\KoreanCalendar\KoreanCalendarGetMonth.cs" /> | ||
<Compile Include="..\KoreanCalendar\KoreanCalendarGetMonthsInYear.cs" /> | ||
<Compile Include="..\KoreanCalendar\KoreanCalendarGetWeekOfYear.cs" /> | ||
<Compile Include="..\KoreanCalendar\KoreanCalendarGetYear.cs" /> | ||
<Compile Include="..\KoreanCalendar\KoreanCalendarIsLeapDay.cs" /> | ||
<Compile Include="..\KoreanCalendar\KoreanCalendarIsLeapMonth.cs" /> | ||
<Compile Include="..\KoreanCalendar\KoreanCalendarIsLeapYear.cs" /> | ||
<Compile Include="..\KoreanCalendar\KoreanCalendarToFourDigitYear.cs" /> | ||
<Compile Include="..\KoreanCalendar\KoreanCalendarTwoDigitYearMax.cs" /> | ||
<Compile Include="..\Misc\MiscCalendars.cs" /> | ||
<Compile Include="..\Misc\Calendars.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiwanCalendarUtilities.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiwanCalendarAddMonths.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiwanCalendarAddYears.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiwanCalendarDaysAndMonths.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiwanCalendarGetDayOfMonth.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiwanCalendarGetDayOfWeek.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiwanCalendarGetDayOfYear.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiwanCalendarGetDaysInMonth.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiwanCalendarGetDaysInYear.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiwanCalendarGetEra.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiwanCalendarGetMonth.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiwanCalendarGetMonthsInYear.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiwanCalendarGetWeekOfYear.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiwanCalendarGetYear.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiwanCalendarIsLeapDay.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiwanCalendarIsLeapMonth.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiWanCalendarIsLeapYear.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiwanCalendarToDateTime.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiwanCalendarToFourDigitYear.cs" /> | ||
<Compile Include="..\TaiwanCalendar\TaiwanCalendarTwoDigitYearMax.cs" /> | ||
<Compile Include="..\ThaiBuddhistCalendar\ThaiBuddhistCalendarAddMonths.cs" /> | ||
<Compile Include="..\ThaiBuddhistCalendar\ThaiBuddhistCalendarAddYears.cs" /> | ||
<Compile Include="..\ThaiBuddhistCalendar\ThaiBuddhistCalendarGetDayOfMonth.cs" /> | ||
<Compile Include="..\ThaiBuddhistCalendar\ThaiBuddhistCalendarGetDayOfWeek.cs" /> | ||
<Compile Include="..\ThaiBuddhistCalendar\ThaiBuddhistCalendarGetDayOfYear.cs" /> | ||
<Compile Include="..\ThaiBuddhistCalendar\ThaiBuddhistCalendarGetDaysInMonth.cs" /> | ||
<Compile Include="..\ThaiBuddhistCalendar\ThaiBuddhistCalendarGetDaysInYear.cs" /> | ||
<Compile Include="..\ThaiBuddhistCalendar\ThaiBuddhistCalendarGetEra.cs" /> | ||
<Compile Include="..\ThaiBuddhistCalendar\ThaiBuddhistCalendarGetMonth.cs" /> | ||
<Compile Include="..\ThaiBuddhistCalendar\ThaiBuddhistCalendarGetMonthsInYear.cs" /> | ||
<Compile Include="..\ThaiBuddhistCalendar\ThaiBuddhistCalendarGetWeekOfYear.cs" /> | ||
<Compile Include="..\ThaiBuddhistCalendar\ThaiBuddhistCalendarGetYear.cs" /> | ||
<Compile Include="..\ThaiBuddhistCalendar\ThaiBuddhistCalendarIsLeapDay.cs" /> | ||
<Compile Include="..\ThaiBuddhistCalendar\ThaiBuddhistCalendarIsLeapMonth.cs" /> | ||
<Compile Include="..\ThaiBuddhistCalendar\ThaiBuddhistCalendarIsLeapYear.cs" /> | ||
<Compile Include="..\ThaiBuddhistCalendar\ThaiBuddhistCalendarToDateTime.cs" /> | ||
<Compile Include="..\ThaiBuddhistCalendar\ThaiBuddhistCalendarToFourDigitYear.cs" /> | ||
<Compile Include="..\ThaiBuddhistCalendar\ThaiBuddhistCalendarTwoDigitYearMax.cs" /> | ||
<Compile Include="$(CommonTestPath)System\RandomDataGenerator.cs" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.