datesEqualAtResolution function
Implementation
bool datesEqualAtResolution(Date a, Date b, CalendarResolution resolution) {
switch (resolution) {
case CalendarResolution.years:
return a.year == b.year;
case CalendarResolution.months:
return a.year == b.year && a.month == b.month;
case CalendarResolution.days:
return a == b;
case CalendarResolution.weeks:
default:
throw ArgumentError('Equality not supported at resolution: $resolution');
}
}