Bug 28887 - NSDatePicker has different values for different OS Xs
Summary: NSDatePicker has different values for different OS Xs
Status: CONFIRMED
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
URL:
Depends on:
Blocks:
 
Reported: 2015-04-08 11:21 UTC by David Lilley
Modified: 2016-09-26 21:58 UTC (History)
2 users (show)

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


Attachments
Sample Code (15.29 KB, application/zip)
2015-04-08 11:21 UTC, David Lilley
Details
Objective C Test (66.00 KB, application/zip)
2015-04-08 12:02 UTC, David Lilley
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 for Bug 28887 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

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:

https://gist.github.com/chamons/41de8ef6a64059ffdfd1

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.