Skip to content

[fix-finder] Add XML documentation to DatePicker DateTime properties #12305

Description

@github-actions

Problem

The handwritten, .NET-friendly DatePicker.DateTime, MinDateTime, and MaxDateTime properties in the shipped Mono.Android.dll have no XML documentation. Developers cannot tell from IntelliSense that DateTime converts between .NET’s 1-based month and Android’s 0-based month, or that the minimum and maximum properties wrap Android’s millisecond-based date values.

Location

  • File(s): src/Mono.Android/Android.Widget/DatePicker.cs
  • Line(s): 9-19

Current Code

public DateTime DateTime {
	get { return new DateTime (Year, Month + 1, DayOfMonth); }
	set { UpdateDate (value.Year, value.Month - 1, value.Day); }
}
#if ANDROID_11
public DateTime MinDateTime {
	get { return new DateTime (1970, 1, 1).AddMilliseconds (MinDate); }
}
public DateTime MaxDateTime {
	get { return new DateTime (1970, 1, 1).AddMilliseconds (MaxDate); }
}
#endif

Suggested Fix

Add XML documentation directly above all three properties without changing their implementations. Use wording equivalent to:

/// <summary>Gets or sets the date selected in this picker.</summary>
/// <remarks>Only the year, month, and day components are used when setting the value. This property converts between .NET’s 1-based month and Android’s 0-based month.</remarks>
/// <seealso href="(developer.android.com/redacted) `DatePicker` documentation</seealso>
public DateTime DateTime { ... }

#if ANDROID_11
/// <summary>Gets the minimum selectable date supported by this picker.</summary>
/// <value>The minimum date converted from Android’s millisecond value relative to January 1, 1970.</value>
/// <seealso href="(developer.android.com/redacted) `DatePicker.getMinDate` documentation</seealso>
public DateTime MinDateTime { ... }

/// <summary>Gets the maximum selectable date supported by this picker.</summary>
/// <value>The maximum date converted from Android’s millisecond value relative to January 1, 1970.</value>
/// <seealso href="(developer.android.com/redacted) `DatePicker.getMaxDate` documentation</seealso>
public DateTime MaxDateTime { ... }
#endif

The owning project is src/Mono.Android/Mono.Android.csproj, which resolves to net11.0 and LangVersion=latest. The suggested fix introduces no runtime APIs or language syntax beyond XML comments.

Guidelines

  • Follow dotnet/android formatting conventions: tabs for indentation and a space before (.
  • Keep this documentation-only; do not alter property behavior or conditional compilation.
  • Use the linked official Android DatePicker API documentation.

Acceptance Criteria

  • DateTime, MinDateTime, and MaxDateTime each have an XML <summary>.
  • The comments explain the month conversion and the Android millisecond date conversion where applicable.
  • The comments link to the relevant official Android documentation.
  • Property behavior and #if ANDROID_11 guards remain unchanged.
  • All tests pass
  • No new warnings introduced

Fix-finder metadata

  • Script: 04-missing-xml-docs
  • Score: 30/30 (actionability: 10, safety: 10, scope: 10)

Generated by Nightly Fix Finder · gpt56 · 47.5 AIC · ⌖ 24.7 AIC · ⊞ 28.5K ·

  • expires on Aug 13, 2026, 2:26 AM UTC

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions