isSameWeek method
Returns true if the date is in the same week as other.
Example:
DateTime(2024, 1, 15).isSameWeek(DateTime(2024, 1, 16)); // true
Implementation
bool isSameWeek(DateTime other) {
return startOfWeek.isSameDay(other.startOfWeek);
}