Bug 34776 - DateUtils.FormatSameDayTime expecting different values that the original Java version
Summary: DateUtils.FormatSameDayTime expecting different values that the original Java...
Alias: None
Product: Android
Classification: Xamarin
Component: General (show other bugs)
Version: 5.1
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
Depends on:
Reported: 2015-10-12 15:19 UTC by Nuno
Modified: 2015-10-19 09:44 UTC (History)
3 users (show)

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

Sample Project (30.59 KB, application/zip)
2015-10-12 15:19 UTC, Nuno

Description Nuno 2015-10-12 15:19:07 UTC
Created attachment 13289 [details]
Sample Project

The last 2 parameters of  C# version of DateUtils.FormatSameDayTime are values from Android.Text.Format.AbbreviationLength, but the AbbreviationLength enum has a different range of values those expected by the original Java version.

Using any value of AbbreviationLength enum will crash the app.

Android version:
http://developer.android.com/reference/android/text/format/DateUtils.html#formatSameDayTime(long, long, int, int)
The last 2 parameters expect values from 0 to 3.

Xamarin version:

Xamarin Studio
Version 5.9.7 (build 22)
	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

Version: (Business Edition)
Hash: 1d27ac2
Branch: master
Build date: 2015-09-25 18:08:44-0400

Version: (Business Edition)
Android SDK: 
	Supported Android versions:
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)
		6.0    (API level 23)
Java SDK: /usr
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

Build Information
Release ID: 509070022
Git revision: 6bd1f169df44ca96addf8a035316c535a4fa46fa
Build date: 2015-09-30 12:30:15-04
Xamarin addins: 1c3e5c0859bdfec0ecd481a57ad6c03bc22f5536

Operating System
Mac OS X 10.10.5
Darwin 14.5.0 Darwin Kernel Version 14.5.0
    Wed Jul 29 02:26:53 PDT 2015
    root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64
Comment 1 Atsushi Eno 2015-10-19 09:44:10 UTC
You're right. Those methods parameters should not have enumified type. These methods will just take int constants in the next major update. Thanks for the report.

[master 026b050]

Notice (2018-05-21): bugzilla.xamarin.com will be switching to read-only mode on Thursday, 2018-05-25 22:00 UTC.

Please join us on Visual Studio Developer Community and GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs and copy them to the new locations as needed for follow-up. The See Also field on each Bugzilla bug will be updated with a link to its new location when applicable.

After Bugzilla is read-only, if you have new information to add for a bug that does not yet have a matching issue on Developer Community or GitHub, you can create a follow-up issue in the new location. Copy and paste the title and description from this bug, and then add your new details. You can get a pre-formatted version of the title and description here:

In special cases you might also want the comments:

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.

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