-
Notifications
You must be signed in to change notification settings - Fork 1.9k
DatePicker MinimumDate/MaximumDate shouldn't be selectable #3048
Comments
I am facing a similar issue right now. While I'd like if a datepicker didn't allow the selection of days in the past, I still need it to show yesterday if it's set from another source, e.g. a database. |
The UWP control doesn't actually have a minimum date. It has only a Instead of using DatePicker on UWP, I think it would be better if the native control would be the CalendarView: https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Controls.CalendarView which supports setting minimum and maximum date. On Android the renderer is actually a calendar which supports min/max dates. On iOS, the native control (UIDatePicker) also supports min/max dates. It's up to the Xamarin Forms team to approve changing the UWP renderer to use the CalendarView |
Update on current behavior that might need review: IOS: |
Thanks for this suggestion! As Xamarin.Forms is now in maintenance mode, this will not happen anymore for Xamarin.Forms. We're only adding bugfixes and stability fixes. If this is still important to you, make sure to check the .NET MAUI repo and see if it's already on the roadmap. If not, feel free to open a discussion to discuss a change first or open an issue with a detailed feature request. Thanks! |
Description
When MinimumDate is set to today and we choose yesterday, today will be chosen for DateProperty. It would be great when everything lower than MinimumDate couldn't be chosen at all (e.g. it wouldn't scroll to a date lower then MinimumDate). The same for MaximumDate. The current implementation could cause confusion. When the user chooses a date that is lower than MinimumDate the DateProperty will be magically set to today. Without giving feedback to the user.
Steps to Reproduce / Actual Behavior
MinimumDate was set to today.
Expected Behavior
MinimumDate was set to today.
Solution: Open DatePicker and choose yesterday (that shouldn't be possible)
Optional solution: Click "Accept" (or it shouldn't be possible to click accept)
Basic Information
The text was updated successfully, but these errors were encountered: