highlighted method
Return true if the given date is highlighted by the given selection, or by a preview of the given selection.
Implementation
bool highlighted(String? id, Date date) {
//assert(date != null);
if (preview != null && currentSelection == id) {
var current = selection(currentSelection);
var anchor = previewAnchoredAtStart ? current.start : current.end;
var previewStart = earlierOf(preview!, anchor);
var previewEnd = laterOf(preview!, anchor);
return !date.isBefore(previewStart) && !date.isAfter(previewEnd);
} else {
return selection(id).contains(date);
}
}