Bug 44011 - Error in DatePicker.Date default value
Summary: Error in DatePicker.Date default value
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.3.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Stephane Delcroix
Depends on:
Reported: 2016-09-06 11:05 UTC by Arne De Vreese
Modified: 2017-06-01 07:36 UTC (History)
6 users (show)

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

Test project (196.68 KB, application/x-zip-compressed)
2016-09-06 11:05 UTC, Arne De Vreese

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:

Description Arne De Vreese 2016-09-06 11:05:38 UTC
Created attachment 17338 [details]
Test project

## Description

When a DatePicker instance is instantiated the value of the Date property is automatically set to the date the application was launched, not to the current date.

When the systemdate changes (manually or because midnight passes) while the application is running, the Date property of new DatePicker instances will default to the original 'current date', not to the new one.

## Steps to reproduce

1. Launch the attached test project to an Android or iOS device or simulator. Two DatePickers and one Label will be displayed all showing the current (system) date.

2. Change the system date of the device

3. Click 'New' to open a new instance of the same View containing two new DatePicker instances and one new Label.

Expected result: both the two new DatePicker instances and the Label should show the new system date.

Actual result: the 2nd DatePicker, for which the Date was explicitly set to the current system date, shows the correct date, but the 1st DatePicker for which no value was set, defaults to the original date (launch date of the app).
Comment 2 adrianknight89 2016-10-19 14:02:21 UTC
This is already in master now: https://github.com/xamarin/Xamarin.Forms/pull/423
Comment 3 Parmendra Kumar 2016-11-21 16:29:06 UTC
I have checked this issue with latest forms version and still getting same issue on both android and iOS.

Screencast: http://www.screencast.com/t/zmnrfYnHMIw

Hence reopen this issue.
Comment 4 adrianknight89 2016-11-21 16:38:13 UTC
I'm not sure if it was released yet. Maybe it will appear in the next pre1.
Comment 5 Parmendra Kumar 2016-11-25 05:59:27 UTC
@Adrianknight, I have checked this issue with latest pre version 2.3.4-pre1 and still getting same issue as mentioned in comment #3.

Comment 6 Samantha Houts [MSFT] 2017-03-22 21:37:03 UTC
I confirm that https://github.com/xamarin/Xamarin.Forms/pull/423 was not a fix for this issue.
Comment 7 Stephane Delcroix 2017-05-30 12:35:11 UTC
Comment 8 Stephane Delcroix 2017-06-01 07:36:22 UTC
will be fixed in 2.3.6-pre1