isSameMonth method
Returns true if the date is in the same month as other.
Example:
DateTime(2024, 1, 15).isSameMonth(DateTime(2024, 1, 20)); // true
Implementation
bool isSameMonth(DateTime other) {
return year == other.year && month == other.month;
}