Skip to content

Commit

Permalink
limit calendar to no later than current month
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencohn committed May 3, 2024
1 parent 16893a4 commit 6e42213
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions OneMoreCalendar/CalendarForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ private async Task SetMonth(int delta)
: date.AddMonths(delta);
}

if (date.StartOfMonth() > DateTime.Now.StartOfMonth())
{
date = DateTime.Now.StartOfMonth();
return;
}

var endDate = date.EndOfMonth();
var settings = new SettingsProvider();

Expand Down

0 comments on commit 6e42213

Please sign in to comment.