diff --git a/src/Calendar.Plugin/Shared/Controls/Calendar.xaml.cs b/src/Calendar.Plugin/Shared/Controls/Calendar.xaml.cs index 855858f..8bf1266 100644 --- a/src/Calendar.Plugin/Shared/Controls/Calendar.xaml.cs +++ b/src/Calendar.Plugin/Shared/Controls/Calendar.xaml.cs @@ -1055,7 +1055,7 @@ private static void OnMonthChanged(BindableObject bindable, object oldValue, obj throw new ArgumentException("Month must be between 1 and 12."); if (bindable is Calendar calendar && calendar.ShownDate.Month != newMonth) - calendar.ShownDate = new DateTime(calendar.Year, newMonth, calendar.Day); + calendar.ShownDate = new DateTime(calendar.Year, newMonth, Math.Min(DateTime.DaysInMonth(calendar.Year, newMonth), calendar.Day)); } private static void OnDayChanged(BindableObject bindable, object oldValue, object newValue)