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

[Android / iOS ] Native DatePicker and CalendarDatePicker flyout opens 100 years in the past instead of today #19505

Closed
KikkoMax opened this issue Feb 11, 2025 · 9 comments · Fixed by #19519, #19581 or #19662
Assignees
Labels
area/date-time-pickers DatePicker, TimePicker, CalendarDatePicker... difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working

Comments

@KikkoMax
Copy link

KikkoMax commented Feb 11, 2025

Current behavior

Native date picker on Android and iOS opens 100 years in the past by default.

Calendar date picker opens 100 years in the past for iOS by default.

Expected behavior

Calendar flyouts should open with today as the default date.

How to reproduce it (as minimally and precisely as possible)

  1. Build and start app
  2. Open native date picker
  3. Observe year is 1925 instead of 2025
  4. Open managed date picker
  5. Observe correct behavior, year is 2025
  6. Open calendar date picker
  7. Observe year is 1925 instead of 2025 for iOS, but 2025 on android

DatePickerBug.zip

Workaround

Using the managed date picker works around the problem but this results in a different UX.

Works on UWP/WinUI

Yes

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

Uno.WinUI 5.6.33 (sdk 5.6.22)

Affected platforms

Android, iOS

IDE

Visual Studio 2022

IDE version

17.12.4

Relevant plugins

JetBrains ReSharper 2024.3.5

Anything else we need to know?

No response

@KikkoMax KikkoMax added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Feb 11, 2025
@MartinZikmund MartinZikmund self-assigned this Feb 11, 2025
@jeromelaban jeromelaban added area/date-time-pickers DatePicker, TimePicker, CalendarDatePicker... and removed triage/untriaged Indicates an issue requires triaging or verification labels Feb 11, 2025
@agneszitte
Copy link
Contributor

agneszitte commented Feb 20, 2025

@MartinZikmund I am re-opening this issue as I am still able to reproduce it with latest Uno.Sdk 5.6.36 for the CalendarDatePicker for iOS.

*(For managed DatePicker I also noticed a separate issue for iOS, which will be tracked with #19567)

Image


Tested with:

  • Templates/SDK: 5.6.36
  • VS version: VS 2022 (64-bit) - Version 17.13.1
  • VS VSIX: 5.6.31
  • Issue19505.zip
  • Platform(s):
    • ✅ WinAppSdk
    • ✅ Android
    • ❌ iOS
    • ✅WebAssembly
    • ✅Desktop
    • ✅Desktop WSL
  • OS: Windows

@agneszitte
Copy link
Contributor

agneszitte commented Mar 3, 2025

I am still able to reproduce this issue with latest internal Uno.Sdk 5.6.42 for the issue left for iOS for the CalendarDatePicker.
Should normally be fixed in the next stable version based on the fact that the backport was just merged (#19590). Will re-test it when available.


Tested with:

  • Templates/SDK: 5.6.42
  • VS version: VS 2022 (64-bit) - Version 17.13.2
  • VS VSIX: 5.6.37
  • Platform(s): iOS
  • OS: Windows

@jeromelaban jeromelaban reopened this Mar 4, 2025
@agneszitte
Copy link
Contributor

agneszitte commented Mar 4, 2025

@jeromelaban, @MartinZikmund

Here are more updates based on my latest tests for the issue left for iOS for the CalendarDatePicker.

  • With latest internal uno.sdk 5.6.43:
    The issue persists as the backport merge build failed at some point, preventing the changes from being included in the latest internal stable Uno.Sdk version.

  • With latest uno.sdk 5.7.0-dev.167:
    But even with the changes from #19581, the issue is not fully resolved, as some dates for the current month are missing, and today's date (2025-03-04 for my current test here) is neither visible nor selectable.

    Also, I am seeing some System.NullReferenceException: Object reference not set to an instance of an object. when switching between months:

     2025-03-04 17:21:18.452871-0500 Issue19505[70777:2952593] fail: Microsoft.UI.Xaml.FrameworkElement[0] Layout failed in Microsoft.UI.Xaml.Controls.Primitives.CalendarPanel
     System.NullReferenceException: Object reference not set to an instance of an object.
        at Uno.UI.Xaml.Controls.BorderLayerRenderer.InnerCreateLayer(UIElement owner, CALayer parent, BorderLayerState state, CGPath& updatedBoundsPath)
        at Uno.UI.Xaml.Controls.BorderLayerRenderer.UpdatePlatform(Boolean forceUpdate)
        at Uno.UI.Xaml.Controls.BorderLayerRenderer.Update(Boolean forceUpdate)
        at Uno.UI.Xaml.Controls.BorderLayerRenderer.<.ctor>b__3_2(Object _, Object _)
        at Microsoft.UI.Xaml.FrameworkElement.OnLayoutUpdated()
        at Microsoft.UI.Xaml.Controls.Layouter.Arrange(Rect finalRect)
        at Microsoft.UI.Xaml.UIElement.Arrange(Rect finalRect)
        at Microsoft.UI.Xaml.Controls.Primitives.CalendarPanel.base_ArrangeOverride(Size finalSize)
        at Microsoft.UI.Xaml.Controls.Primitives.CalendarPanel.ArrangeOverride(Size finalSize)
        at Microsoft.UI.Xaml.FrameworkElement.FrameworkElementLayouter.ArrangeOverride(Size finalSize)
        at Microsoft.UI.Xaml.Controls.Layouter.Arrange(Rect finalRect)
        at Microsoft.UI.Xaml.FrameworkElement.LayoutSubviews()
     2025-03-04 17:21:18.483518-0500 Issue19505[70777:2952593] fail: Microsoft.UI.Xaml.FrameworkElement[0] Layout failed in Microsoft.UI.Xaml.Controls.CalendarViewDayItem
     System.NullReferenceException: Object reference not set to an instance of an object.
        at Uno.UI.Xaml.Controls.BorderLayerRenderer.InnerCreateLayer(UIElement owner, CALayer parent, BorderLayerState state, CGPath& updatedBoundsPath)
        at Uno.UI.Xaml.Controls.BorderLayerRenderer.UpdatePlatform(Boolean forceUpdate)
        at Uno.UI.Xaml.Controls.BorderLayerRenderer.Update(Boolean forceUpdate)
        at Uno.UI.Xaml.Controls.BorderLayerRenderer.<.ctor>b__3_2(Object _, Object _)
        at Microsoft.UI.Xaml.FrameworkElement.OnLayoutUpdated()
        at Microsoft.UI.Xaml.Controls.Layouter.Arrange(Rect finalRect)
        at Microsoft.UI.Xaml.FrameworkElement.LayoutSubviews()
    

    Image

    Issue19505.mp4

Tested with:

  • Templates/SDK: 5.6.43 and 5.7.0-dev.167
  • VS version: VS 2022 (64-bit) - Version 17.13.2
  • VS VSIX: 5.6.38
  • Platform(s): iOS
  • OS: Windows
  • Issue19505.zip

@jeromelaban
Copy link
Member

jeromelaban commented Mar 5, 2025

@agneszitte the managed picker on iOS/Android is not a priority at this time, only the native picker is prioritized.

@agneszitte
Copy link
Contributor

agneszitte commented Mar 5, 2025

@agneszitte the managed picker on iOS/Android is not a priority at this time, only the native picker is prioritized.

@jeromelaban I am testing the issue left for <CalendarDatePicker /> for iOS on my video and in my code (#19567 is tracked separately for managed DatePicker)

@jeromelaban
Copy link
Member

jeromelaban commented Mar 5, 2025

@KikkoMax to be sure, which pickers are of importance to you? The native DatePicker, CalendarDatePicker, or both? Thanks!

@KikkoMax
Copy link
Author

KikkoMax commented Mar 5, 2025

The native DatePicker is what we currently use in production but we were looking at using the CalendarDatePicker for iOS instead (walked back because of current issues). So I'd say both ;)

@jeromelaban
Copy link
Member

@KikkoMax Thanks, this helps!

@agneszitte
Copy link
Contributor

agneszitte commented Mar 20, 2025

@jeromelaban, @MartinZikmund the remaining issues for CalendarDatePicker I previously noticed for iOS seems now properly fixed with latest internal Uno.Sdk 5.6.51.

(While testing I found another issue for the Native DatePicker for Android, so I entered separated #19724 to track the details)

CalendarDatePicker-iOS-issue-fixed.mp4

Tested with:

  • Templates/SDK: 5.6.51 (which contains Uno version 5.6.91)
  • Platform(s): iOS, Desktop, WebAssembly, Android, WinAppSdk
  • OS: Windows
  • DatePickersTests.zip
Component Version
VS 2022 17.13.4
Uno VS VSIX 5.6.42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/date-time-pickers DatePicker, TimePicker, CalendarDatePicker... difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working
Projects
None yet
5 participants