Bug 28424 - [Android][WinPhone] When setting the minimum and maximum date for a date picker, only allow valid dates to be seen/selected from the DatePicker dialog.
Summary: [Android][WinPhone] When setting the minimum and maximum date for a date pick...
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.1
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-03-25 15:25 UTC by Jon Goldberger [MSFT]
Modified: 2015-04-27 13:59 UTC (History)
7 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test Project (193.90 KB, application/zip)
2015-03-25 15:25 UTC, Jon Goldberger [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Jon Goldberger [MSFT] 2015-03-25 15:25:03 UTC
Created attachment 10503 [details]
Test Project

## Description

On iOS when there is a minimum and/or maximum date set for the DatePicker, if you try to select an out of range date, the picker automatically changes itself to the set minimum or maximum date, whichever is closer to the selected date, thus indicating to the user that they were trying to select an out of range date. On WinPhone or Android, however, you can scroll the date picker to any date. Once "Done" is pressed, the text field will display the correct minimum or maximum date if an out of range date was selected, so ultimately the min/max date is respected, but the user is not made aware that the date set is not the date that they selected with the scrolling date picker... other than the date picker text field not showing the date they selected, but rather the min/max date.

I tried a native android DatePickerDialog and setting the min/max date in the native app did limit the dates that can be selected in the date picker dialog, IOW a user can not select an out of range date. I did not test this on WinPhone but it was reported that the WinPhone behavior is similar to the Android behavior. 

## Steps to reproduce

1. Open the attached test project and restore packages.

2. Launch the android app.

3. Tap the date field.

4. Try to select a date before January 1, 2015 (the set minimum date) or after June 1, 2015 (the set maximum date)

Expected result: I will not be able to select an out of range date.

Actual result: I can select an our of range date. Once "Done" is tapped, the date text field does indeed display the correct date, i.e. the minimum or maximum if an out of range date was selected in the picker. 


## Note

If you run the iOS app and repeat the steps above, you will see that the date picker auto scrolls to the minimum or maximum date if an out of range date is selected.
Comment 3 Rui Marinho 2015-04-17 16:22:56 UTC
For Android, should be fixed in 1.4.3-pre1, WP8.1 already has this fixed
Comment 4 Parmendra Kumar 2015-04-27 13:59:04 UTC
I have checked this issue on android with Xamarin.Forms 1.4.3-pre2 and its working fine at my end.

Hence closing this issue.