Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/Mono.Android/Android.Widget/DatePicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,23 @@ namespace Android.Widget {

public partial class DatePicker
{
/// <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="https://developer.android.com/reference/android/widget/DatePicker">Android documentation for <c>android.widget.DatePicker</c></seealso>
public DateTime DateTime {
get { return new DateTime (Year, Month + 1, DayOfMonth); }
set { UpdateDate (value.Year, value.Month - 1, value.Day); }
}
#if ANDROID_11
/// <summary>Gets the minimum selectable date supported by this picker.</summary>
/// <value>The minimum date converted from Android's millisecond value (milliseconds since January 1, 1970 00:00:00 in the device's default time zone).</value>
/// <seealso href="https://developer.android.com/reference/android/widget/DatePicker#getMinDate()">Android documentation for <c>android.widget.DatePicker.getMinDate</c></seealso>
Comment thread
Copilot marked this conversation as resolved.
public DateTime MinDateTime {
get { return new DateTime (1970, 1, 1).AddMilliseconds (MinDate); }
}
/// <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="https://developer.android.com/reference/android/widget/DatePicker#getMaxDate()">Android documentation for <c>android.widget.DatePicker.getMaxDate</c></seealso>
public DateTime MaxDateTime {
get { return new DateTime (1970, 1, 1).AddMilliseconds (MaxDate); }
}
Expand Down