Bug 31412 - TimePicker.Time is set to 12:00 AM when using DateTime.TimeOfDay for a day occurring in the past or future
Summary: TimePicker.Time is set to 12:00 AM when using DateTime.TimeOfDay for a day oc...
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.3
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Rui Marinho
URL:
Depends on:
Blocks:
 
Reported: 2015-06-26 12:33 UTC by Mike
Modified: 2015-07-06 14:48 UTC (History)
6 users (show)

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


Attachments
Example Project (278.18 KB, application/x-zip-compressed)
2015-06-26 12:33 UTC, Mike
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:
RESOLVED NOT_ON_ROADMAP

Description Mike 2015-06-26 12:33:53 UTC
Created attachment 11754 [details]
Example Project

See the example project for a working example of the bug.
Comment 1 Sunil Kumar 2015-06-30 09:27:45 UTC
I have tried to reproduce this issue and getting the same behavior. I downloaded the attached sample and run it. I observed that TimePicker.Time is set to 12:00 AM. 

Screencast: http://www.screencast.com/t/OpBdiLi1Vu
IDE log: https://gist.github.com/sunil360/843c90efa6094df3de12

Environment info:
XF 1.4.2.6359

=== Xamarin Studio ===

Version 5.9.4 (build 5)
Installation UUID: af8b0e23-bef7-4d92-b9de-c688528f8f70
Runtime:
	Microsoft .NET 4.0.30319.34011
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.26

=== Xamarin.Android ===

Version: 5.1.4 (Business Edition)
Android SDK: C:\Users\Naqeeb\AppData\Local\Android\android-sdk
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: C:\Program Files\Java\jdk1.7.0_71
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Version: 0.3.7.2
Location: C:\Program Files\Xamarin Android Player\DeviceManager.exe

=== Build Information ===

Release ID: 509040005
Git revision: 8010a90f6e246b32364e3fb46ef2c9d1be9c9a2b
Build date: 2015-06-08 17:16:25-04
Xamarin addins: 7e93e9c3503f28770f23ce1b7eafd829919f18e8

=== Operating System ===

Windows 6.2.9200.0 (64-bit)
Comment 3 Jason Smith [MSFT] 2015-07-06 14:48:01 UTC
The DatePicker.Date property always chops the TimeOfDay. You need to bind to separate values. The reason it works when setting DateTime.Now is due to a fluke in the coercion system.