Closed KarthikRajaAKR closed 1 year ago
1@KarthikRajaAKR Thank you for surfacing this issue! We were able to run your solution and reproduce it :)
We are planning to finish work on this issue, but our team is prioritizing Xcode 11 binding work.
The workaround we came up with is changing the way that we convert from DateTime to NSDate, here's the code snippet:
var dt2 = dt.ToUniversalTime ();
var calendar = new NSCalendar(NSCalendarType.Gregorian);
calendar.TimeZone = NSTimeZone.FromName("UTC");
var components = new NSDateComponents { Day = dt2.Day, Month = dt2.Month, Year = dt2.Year, Hour = dt2.Hour,
Minute = dt2.Minute, Second = dt2.Second, Nanosecond = dt2.Millisecond * 1000000 };
return calendar.DateFromComponents(components);
Any progress? do we still need to use "workaround"?
@onurhazar yes, you still need to use the workaround, this hasn't been fixed yet.
Description
I'm working in custom Date and TimePicker using UIDatePicker in native iOS renderer file. I tried to convert DateTime value to NSDate using methods attached below. Everything working fine if I set any DateTime value but the conversion not working as expected while DateTime field just initialized or initialized with the date(1/1/0001). In this case, converted date shows (1/3/0001) and add some time also.
NSDate converter
DateTime converter
Steps to Reproduce
Expected Behavior
Converted value should be same
Actual Behavior
Converted values are not same while DateTime field just initialized
Basic Information
Screenshots
Note: Initial DateTime value, Converted NsDate value and Converted DateTime value
Reproduction Link
PickerRendererNSDate.zip
Which is working fine for all other dates than 01/01/0001.