What is wrong here:
DateTime dateForButton = DateTime.Now;
dateForButton = dateForButton.AddDays(-1); // ERROR: un-representable DateTime
The added or subtracted value results in an un-representable DateTime.
Parameter name: value
That error usually occurs when you try to subtract an interval from
DateTime.MinValue or you want to add something to
DateTime.MaxValue (or you try to instantiate a date outside this min-max interval). Are you sure you're not assigning