unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
8.88k stars 717 forks source link

[iOS] DatePicker MaxYear property ignores month and day. #6034

Closed takla21 closed 3 years ago

takla21 commented 3 years ago

Current behavior

Only the year in DatePicker.MaxYear is used when limiting the max date on UIDatePicker.

current_public

Expected behavior

In previous version, the UIDatePicker used to block month and day as well. expected_public

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

Workaround

N/A

Environment

Nuget Package:

Nuget Package Version(s): 3.8.0-dev.169

Affected platform(s):

IDE:

Relevant plugins:

Anything else we need to know?

jeromelaban commented 3 years ago

@carldebilly isn't this expected ?

carldebilly commented 3 years ago

Yep. That's the expected result as it's exactly the behavior on Windows.

To have min/max dates, you'll need to use CalendarDatePicker/CalendarView: https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.calendardatepicker

CalendarDatePicker Class (Windows.UI.Xaml.Controls) - Windows UWP applications
Represents a control that allows a user to pick a date from a calendar display. Equivalent WinUI class: Microsoft.UI.Xaml.Controls.CalendarDatePicker.
jeromelaban commented 3 years ago

@takla21 is this a regression from your end, or something you'd expect to work ?

takla21 commented 3 years ago

@jeromelaban it's actually a regression for iOS. It used to work (blocking days and month) with the previous uno version we were using (3.1.29)

@carldebilly The thing is that it's does block days and month on android. I've updated the sample on android to the same version as android here DatePickerMaxDateSample.zip. So does it means that it's a bug on android?

android

carldebilly commented 3 years ago

Yep it's a bug :-).

It should be possible to set a feature flag to bring back the old behavior.

To be honest, the "native DatePicker" is a lot closer to CalendarDatePicker than DatePicker itself. I think they should come back as native pickers for CalendarDatePicker instead...

carldebilly commented 3 years ago

Duplicate of https://github.com/unoplatform/uno/issues/5575

takla21 commented 3 years ago

Well, it seems that it's not quite implemented yet https://github.com/unoplatform/uno/issues/3750

MartinZikmund commented 3 years ago

Closing as duplicate