Browse Source

Fix ArgumentOutOfRange exception

pull/4432/head
amwx 6 years ago
parent
commit
836203d033
  1. 9
      src/Avalonia.Controls/DateTimePickers/DatePickerPresenter.cs

9
src/Avalonia.Controls/DateTimePickers/DatePickerPresenter.cs

@ -356,10 +356,17 @@ namespace Avalonia.Controls
} }
if (MonthVisible) if (MonthVisible)
{
_monthSelector.SelectedValue = dt.Month; _monthSelector.SelectedValue = dt.Month;
_monthSelector.FormatDate = dt.Date;
}
if (YearVisible) if (YearVisible)
{
_yearSelector.SelectedValue = dt.Year; _yearSelector.SelectedValue = dt.Year;
_yearSelector.FormatDate = dt.Date;
}
_suppressUpdateSelection = false; _suppressUpdateSelection = false;
SetInitialFocus(); SetInitialFocus();

Loading…
Cancel
Save