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

fix: Improve DateTimeFormatter template matching and mappings #19099

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

morning4coffe-dev
Copy link
Member

GitHub Issue (If applicable): closes #18975

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

Currently the returned values for Time are very off from what they are supposed to compared to WinUI.

What is the new behavior?

The logic for DateTimeFormatter has been improved to prioritize keys by length, starting with the longest. Previously, the Lookup dictionary had to be manually ordered, which could lead to issues. Additional mapping values have been added based on Microsoft documentation, and the dictionary has been cleaned up for better readability. A runtime test has also been added.

PR Checklist

Please check if your PR fulfills the following requirements:

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19099/index.html

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-19099/index.html

@nventive-devops
Copy link
Contributor

The build 150482 found UI Test snapshots differences: android-28-net8: 27, android-28-net8-Snap: 45, ios: 7, ios-Snap: 48, skia-gtk-screenshots: 50, skia-linux-screenshots: 52, skia-windows-screenshots: 65, wasm: 437, wasm-automated-net9.0-UWP-Default-automated: 29, wasm-automated-net9.0-UWP-RuntimeTests-0: 0, wasm-automated-net9.0-UWP-RuntimeTests-1: 0, wasm-automated-net9.0-UWP-RuntimeTests-2: 0, wasm-automated-net9.0-WinUI-Benchmarks-automated: 0, wasm-automated-net9.0-WinUI-RuntimeTests-0: 0, wasm-automated-net9.0-WinUI-RuntimeTests-1: 0, wasm-automated-net9.0-WinUI-RuntimeTests-2: 0

Details
  • android-28-net8: 27 changed over 829

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Detereminate_ProgressRing_Validation50_[#FF0000_#008000_#008000_#FF0000]_Progress-Ring-Value-50
    • Detereminate_ProgressRing_Validation25_[#FF0000_#008000_#FF0000_#FF0000]_Progress-Ring-Value-25
    • ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • When_Clip_Is_Set_On_Child_Element_original
    • When_Clip_Is_Set_On_Child_Element_UITests_Windows_UI_Xaml_UIElementTests_UIElement_Clipping
    • When_Clip_Is_Set_On_Child_Element_validation
    • When_NoSelection_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • UpDownEnabledTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • UpDownTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • When_SingleSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_BitmapIcon_Generic_Changed
    • When_BitmapIcon_Generic_Initial
    • WebView_NavigateToAnchor_Uno_UI_Samples_Content_UITests_WebView_WebView_AnchorNavigation
    • When_Parent_PointerMoved_After_drag_on_non-scrolling_ScrollViewer
    • When_Parent_PointerMoved_After_drag_on_ScrollViewer_-_touch
    • When_BitmapIcon_Generic_UITests_Shared_Windows_UI_Xaml_Controls_BitmapIconTests_BitmapIcon_Generic
    • When_Clip_Is_Set_On_Container_Element_UITests_Windows_UI_Xaml_Clipping_Clipping652
    • When_NoSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • Pivot_Non_PivotItemChange_Validation_UITests_Shared_Windows_UI_Xaml_Controls_Pivot_Pivot_CustomContent_Automated
    • DecimalFormatterTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
  • android-28-net8-Snap: 45 changed over 1066

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Gesture_Recognizer_Pointer_Events_test_bench_UITests_Shared_Windows_UI_Input_GestureRecognizer_PointersEvents
    • NavigationView_MUXControlsTestApp_NavigationViewTopNavPage_MUXControlsTestApp_NavigationViewTopNavPage
    • ListView_ListView_With_ListViews_Count_Measure_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_With_ListViews_Count_Measure
    • SwipeControl_UITests_Windows_UI_Xaml_Controls_SwipeControlTests_SwipeControl_ScrollViewer_UITests_Windows_UI_Xaml_Controls_SwipeControlTests_SwipeControl_ScrollViewer
    • Border_Border_CornerRadius_Clipping_UITests_Windows_UI_Xaml_Controls_BorderTests_Border_CornerRadius_Clipping
    • Border_Border_Simple_Uno_UI_Samples_UITests_BorderTestsControl_Border_Simple
    • Image_Image_Stretch_None_Uno_UI_Samples_UITests_ImageTestsControl_Image_Stretch_None
    • MediaPlayerElement_Mini_player_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Minimal
    • MediaPlayerElement_Sources_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Sources
    • ListView_ListViewSelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • Transform_Basics_UITests_Shared_Windows_UI_Xaml_Media_Transform_Basics
    • Border_Border_CornerRadius_Gradient_UITests_Windows_UI_Xaml_Controls_BorderTests_Border_CornerRadius_Gradient
    • SwipeControl_MUXControlsTestApp_SwipeControlPage2_MUXControlsTestApp_SwipeControlPage2
    • TextBox_UITests_Windows_UI_Xaml_Controls_TextBox_TextBox_SelectionHighlightColor_UITests_Windows_UI_Xaml_Controls_TextBox_TextBox_SelectionHighlightColor
    • TextBox_UITests_Windows_UI_Xaml_Controls_TextBox_TextBox_VerticalAlignment_UITests_Windows_UI_Xaml_Controls_TextBox_TextBox_VerticalAlignment
    • TextBox_UITests_Windows_UI_Xaml_Controls_TextBox_TextBox_Visibility_UITests_Windows_UI_Xaml_Controls_TextBox_TextBox_Visibility
    • TextBlock_TextBlock_FixedWidth_With_DataBound_Run_Uno_UI_Samples_Content_UITests_TextBlockControl_TextBlock_FixedWidth_With_DataBound_Run
    • TextBlock_TextBlock_FontWeight_Uno_UI_Samples_Content_UITests_TextBlockControl_TextBlock_FontWeight
    • TextBlock_TextBlock_Hyperlink_Uno_UI_Samples_Content_UITests_TextBlockControl_TextBlock_Hyperlink
    • MediaPlayerElement_Using_3gp_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_3gp_Extension
  • ios: 7 changed over 267

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • When_NoSelection_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_SingleSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • When_SingleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • TextBox_UpdatedBinding_On_OneWay_Mode_UITests_Windows_UI_Xaml_Controls_TextBox_TextBox_Bindings
  • ios-Snap: 48 changed over 1057

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Brushes_ImageBrushStretch2_Uno_UI_Samples_UITests_ImageBrushTestControl_ImageBrushStretch2
    • Keyboard_Keyboard_Showing_Dismissal_UITests_Shared_Windows_UI_Xaml_Input_Keyboard_Keyboard_Showing_Dismissal
    • SwipeControl_MUXControlsTestApp_SwipeControlPage2_MUXControlsTestApp_SwipeControlPage2
    • TextBlock_TextBoxSizeChanging_Uno_UI_Samples_Content_UITests_TextBlockControl_TextBoxSizeChanging
    • Grid_CenteredGridinGridwiththreefixedsizechildren_Uno_UI_Samples_Content_UITests_GridTestsControl_CenteredGridinGridwiththreefixedsizechildren
    • Grid_Grid_DataBound_ColumnRow_Definitions_Uno_UI_Samples_Content_UITests_GridTestsControl_Grid_DataBound_ColumnRow_Definitions
    • Image_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Horizontal_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Horizontal
    • Image_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Vertical_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Vertical
    • ListView_HorizontalListView_Padding_SamplesApp_Windows_UI_Xaml_Controls_ListView_HorizontalListView_Padding
    • ListView_ListView_WithScrollViewer_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_WithScrollViewer
    • ListView_ListView_With_ListViews_Count_Measure_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_With_ListViews_Count_Measure
    • NavigationView_MUXControlsTestApp_NavigationViewRS4Page_MUXControlsTestApp_NavigationViewRS4Page
    • TextBlock_Attributed_text_FontSize_Changing_Uno_UI_Samples_Content_UITests_TextBlockControl_Attributed_text_FontSize_Changing
    • Brushes_ImageBrushStretch_Uno_UI_Samples_UITests_ImageBrushTestControl_ImageBrushStretch
    • NavigationView_NavigationView_Tapped_UITests_Shared_Windows_UI_Xaml_Controls_NavigationViewTests_NavigationView_Tapped
    • TextBlock_TextBlock_FixedWidth_With_DataBound_Run_Uno_UI_Samples_Content_UITests_TextBlockControl_TextBlock_FixedWidth_With_DataBound_Run
    • Brushes_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList
    • Brushes_BorderImageBrush_Uno_UI_Samples_UITests_ImageBrushTestControl_BorderImageBrush
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Bigger_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Bigger
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Equal_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Equal
  • skia-gtk-screenshots: 50 changed over 2230

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • ToggleButton_IsEnabled_Automated.png-dark
    • ToggleButton_IsEnabled_Automated.png
    • Buttons.png-dark
    • Buttons.png
    • CalendarView_Theming.png
    • BorderImageBrush.png-dark
    • BorderImageBrush.png
    • PathImageBrushfill.png-dark
    • PathImageBrushfill.png
    • Examples.png
    • SplitButtonTestsPage.png-dark
    • Gamepad_CurrentReading.png-dark
    • PasswordBox_AutoFill.png-dark
    • PasswordBox_AutoFill.png
    • Popup_HVAlignments.png-dark
    • Popup_HVAlignments.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • Gamepad_Enumeration.png-dark
  • skia-linux-screenshots: 52 changed over 2230

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Image_Stretch_None.png-dark
    • Image_Stretch_None.png
    • DisplayInformation.png-dark
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • Buttons.png-dark
    • Ellipse.png-dark
    • Ellipse.png
    • Gamepad_Enumeration.png-dark
    • BorderImageBrushRelativeTransform.png-dark
    • Buttons.png
    • LargeImageList.png-dark
    • LargeImageList.png
    • BorderImageBrushRelativeTransform.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
  • skia-windows-screenshots: 65 changed over 2230

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AppWindowPositionAndSize.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • ClipboardTests.png
    • AppWindowPositionAndSize.png-dark
    • CalendarView_Theming.png-dark
    • ImageBrushAlignmentXY2.png-dark
    • ImageBrushAlignmentXY2.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • Gamepad_CurrentReading.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Examples.png-dark
    • Examples.png
  • wasm: 437 changed over 1043

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • GenericApp.Views.Samples.Shared.Content.UITests.GridViewGrouped
    • MUXControlsTestApp.NavigationViewStretchPage
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ComboBox.ComboBox_Popover
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ComboBox.ComboBox_ScrollViewer
    • SamplesApp.Windows_UI_Xaml.Clipping.ButtonWithClippingAndOffset
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewLegacy
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListView_Padding_All_Sides
    • SamplesApp.Windows_UI_Xaml_Shapes.PathTestsControl.PathResizeTest
    • SamplesApp.Windows_UI_Xaml_Shapes.PathTestsControl.PathScrollViewer
    • UITests.Microsoft_UI_Xaml_Controls.NumberBoxTests.NumberBox_Header
    • UITests.Microsoft_UI_Xaml_Controls.ProgressBar.WinUIProgressBarPage
    • UITests.Microsoft_UI_Xaml_Controls.ProgressBar.WinUIProgressBarSimple
    • UITests.Shared.Resources.StaticResource.StaticResource_Simple
    • UITests.Shared.Wasm.Wasm_CustomEvent
    • UITests.Shared.Windows_UI_Xaml.Clipping.ClippingRoundedCorners
    • UITests.Shared.Windows_UI_Xaml.Clipping.ClippingWithOpacity
    • UITests.Shared.Windows_UI_Xaml_Controls.ControlTests.Control_IsEnabled_Inheritance
    • UITests.Shared.Windows_UI_Xaml_Controls.Flyout.Flyout_ButtonInContent
    • UITests.Toolkit.VisibleBoundsPadding_Modal_Test
    • UITests.Windows_UI_Xaml.FocusTests.Focus_VisualStates
  • wasm-automated-net9.0-UWP-Default-automated: 29 changed over 1946

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Default_StrokeThickness_MyEllipse_0_StrokeThickness
    • Default_StrokeThickness_MyPath
    • ListView_ListViewSelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • Default_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected
    • Brushes_BorderImageBrush_Uno_UI_Samples_UITests_ImageBrushTestControl_BorderImageBrush
    • MediaPlayerElement_Using_mp3_Audio_only_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Mp3_Extension
    • MediaPlayerElement_Using_ogg_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Ogg_Extension
    • Default_StrokeThickness_MyRect_0_StrokeThickness
    • Affect_Measurement_polygon_PolygonPage_-_ClearShape
    • Affect_Measurement_polyline_PolylinePage_-_ClearShape
    • Expander_WinUIExpanderPage_UITests_Shared_Microsoft_UI_Xaml_Controls_ExpanderTests_WinUIExpanderPage
    • Pickers_UITests_Windows_UI_Xaml_Controls_CalendarView_CalendarView_Theming_UITests_Windows_UI_Xaml_Controls_CalendarView_CalendarView_Theming
    • Default_StrokeThickness_MyPolyline
    • MediaPlayerElement_Mini_player_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Minimal
    • MediaPlayerElement_Sources_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Sources
    • MediaPlayerElement_Using_3gp_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_3gp_Extension
    • Brushes_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList
    • Default_StrokeThickness_MyPolygon
    • When_NoSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • Validate_Offscreen_Shapes_UITests_Windows_UI_Xaml_Shapes_Offscreen_Shapes
  • wasm-automated-net9.0-UWP-RuntimeTests-0: 0 changed over 1

  • wasm-automated-net9.0-UWP-RuntimeTests-1: 0 changed over 1

  • wasm-automated-net9.0-UWP-RuntimeTests-2: 0 changed over 1

  • wasm-automated-net9.0-WinUI-Benchmarks-automated: 0 changed over 1

  • wasm-automated-net9.0-WinUI-RuntimeTests-0: 0 changed over 1

  • wasm-automated-net9.0-WinUI-RuntimeTests-1: 0 changed over 1

  • wasm-automated-net9.0-WinUI-RuntimeTests-2: 0 changed over 1

@morning4coffe-dev morning4coffe-dev marked this pull request as ready for review December 18, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Tests] Enable RuntimeTests for Time Variants in DateTimeFormatter
4 participants