Bug 34536 - DateTimePicker decrements when custom picker is present
Summary: DateTimePicker decrements when custom picker is present
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-10-02 15:31 UTC by Cody Beyer (MSFT)
Modified: 2015-10-14 05:56 UTC (History)
3 users (show)

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

Simulator in various time zones (255.73 KB, application/zip)
2015-10-12 17:36 UTC, Paul DiPietro [MSFT]

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 Cody Beyer (MSFT) 2015-10-02 15:31:44 UTC
### Description

Using the following sample, when a DateTimePicker is coupled with a custom picker, opening the DateTimePicker decrements the values present

### Regression 

Possible regression of 24580

### Video


### Sample


### Steps to Reproduce

1. Download sample
2. Deploy to iOS Simulator
3. Attempt to modify date within DateTimePicker

### Expected Results

The picker should open a dialog with the value of the picker selected

### Actual Results

The picker dialog opens with date decremented

### Versions

=== Xamarin Studio ===

Version 5.9.7 (build 9)

Installation UUID: 41b41c03-d4de-45ee-92ac-f4a30df8e7e0


Mono 4.0.4 ((detached/d481017)

GTK+ 2.24.23 (Raleigh theme)

Package version: 400040004

=== Apple Developer Tools ===

Xcode 7.0.1 (8228)

Build 7A1001

=== Xamarin.Mac ===

Not Installed

=== Xamarin.iOS ===

Version: (Business Edition)

Hash: d8e9592

Branch: master

Build date: 2015-09-18 23:22:05-0400

=== Xamarin.Android ===

Version: (Business Edition)

Android SDK: /Users/tim/Library/Developer/Xamarin/android-sdk-macosx

Supported Android versions:

2.3   (API level 10)

4.0.3 (API level 15)

4.4   (API level 19)

5.0   (API level 21)

5.1   (API level 22)

Java SDK: /usr

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: Unknown version

Location: /Applications/Xamarin Android Player.app

=== Build Information ===

Release ID: 509070009

Git revision: 31fa64709030b3edb971237780a452a4c69943c4

Build date: 2015-09-17 11:44:37-04

Xamarin addins: b105d33d8cd72911ff2cf3ee0b7715d37e5f19a6

=== Operating System ===

Mac OS X 10.11.0

Darwin Tims-iMac.local 15.0.0 Darwin Kernel Version 15.0.0

    Wed Aug 26 16:57:32 PDT 2015

    root:xnu-3247.1.106~1/RELEASE_X86_64 x86_64
Comment 1 tim.ahrentlov 2015-10-05 10:17:03 UTC
Related to bug: https://bugzilla.xamarin.com/show_bug.cgi?id=24580
Comment 2 Paul DiPietro [MSFT] 2015-10-12 11:33:27 UTC
I believe that this issue may be directly related to this one: https://bugzilla.xamarin.com/show_bug.cgi?id=34739
Comment 3 tim.ahrentlov 2015-10-12 15:29:37 UTC
Paul. Try downloadning the test case. Can you replicate the error?
Comment 4 tim.ahrentlov 2015-10-12 15:30:27 UTC
That would be the test case from this original bug https://bugzilla.xamarin.com/show_bug.cgi?id=24580
Comment 5 Paul DiPietro [MSFT] 2015-10-12 17:35:45 UTC
Let me elaborate on what I found after several hours of investigation last week as there are several parameters which will cause the bug to occur.

The bug is time/time zone dependent. Running the bug before 8PM EST (-5, my time zone) will not cause it to occur. Running it after that point causes the first two selectors in the picker to not work. Its timezone is based on GMT, and unless I missed something, even setting the custom picker's time zone to UTC did not actually change this value when I delved into the visual element in the XS watcher. This may not be true, though, so please don't hold me to it. The thing is, however, that 8PM EST would be 12AM UTC, but the extra hour for DST is being factored in.

If you manually go into your system settings and change the local time (which affects the time on the iOS simulator, there are varying affects going on. Setting the date and time ahead of UTC (say +2 for Paris or +9 for Tokyo) causes completely different effects; I'm going to attach a .zip of screenshots from the 9th of what I personally have seen. What you should see is as follows:

- At 1:11 PM (-5), the picker is fine.
- At 5:12 UTC (-/+0), the picker is still fine.
- At 8:13 (+3), the date, month, and year are off as described in the initial report.
- At 2:14 (+9), the same thing happens as +3.

The report I linked prior was filed in the last couple of days and other than being an extreme coincidence, I would not be surprised if the two are related.
Comment 6 Paul DiPietro [MSFT] 2015-10-12 17:36:13 UTC
Created attachment 13294 [details]
Simulator in various time zones
Comment 7 tim.ahrentlov 2015-10-13 03:40:14 UTC
Cool! Thank you for you efforts. I'll see if I can get my customer support contact to move with this info.
Comment 8 Rui Marinho 2015-10-14 05:56:26 UTC
Set your picker timezone to UTC. There seems to be some weird behaviors in
UIKit if you dont.