Bug 28887 - NSDatePicker has different values for different OS Xs
Summary: NSDatePicker has different values for different OS Xs
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) (show other bugs)
Version: 1.12.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: master
Assignee: Bugzilla
Depends on:
Reported: 2015-04-08 11:21 UTC by David Lilley
Modified: 2016-09-26 21:58 UTC (History)
2 users (show)

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

Sample Code (15.29 KB, application/zip)
2015-04-08 11:21 UTC, David Lilley
Objective C Test (66.00 KB, application/zip)
2015-04-08 12:02 UTC, David Lilley

Description David Lilley 2015-04-08 11:21:35 UTC
Created attachment 10674 [details]
Sample Code

When I run the attached sample I get different values if I run under OS X Yosemite or Other e.g. Mavericks

m_aPicker= new NSDatePicker(new CGRect(100,100,200,200 ));
			m_aPicker.DatePickerElements = NSDatePickerElementFlags.YearMonthDateDay;
			m_aPicker.DatePickerMode = NSDatePickerMode.Single;
			m_aPicker.TimeZone = new NSTimeZone("UTC");
			m_aPicker.DatePickerStyle = NSDatePickerStyle.ClockAndCalendar;
			m_aPicker.Bordered = false;
			m_aPicker.DateValue =  DateTimeToNSDate(DateTime.Today);

On Yosemite it will show 8 April 2015 
On Mavericks or below I get 7 March 2015

Apple Bug ? Xamarin Bug ?

I cannot see anything in the documentation that suggests differences ?
Comment 1 Chris Hamons 2015-04-08 11:35:14 UTC
The 100% way to determine who's "fault" this is to compare it to an objective-c version:


I believe this is a Cocoa bug unless proven otherwise :) We do very little in the binding code related to dates.
Comment 2 David Lilley 2015-04-08 12:02:33 UTC
Created attachment 10675 [details]
Objective C Test
Comment 3 David Lilley 2015-04-08 12:03:44 UTC
Just tried the sample you suggested and both Mavericks and Yosemite are showing correctly, Which is not what I am seeing as Xamarin version.
Comment 4 Chris Hamons 2015-04-08 13:49:11 UTC
Hmm. We'll have to do some digging if C# is different than obj-c.

Note You need to log in before you can comment on or make changes to this bug.