Returns true if the two DateTime objects have the same month and year, or are both null.
bool isSameMonth(T? dateA, T? dateB) { return dateA?.year == dateB?.year && dateA?.month == dateB?.month; }