isYesterday method
Implementation
bool isYesterday([DateTime? locDateTime]) {
locDateTime ??= DateTime.now();
if (equalsYear(locDateTime)) {
final int spDay = locDateTime.dayOfYear - dayOfYear;
return spDay == 1;
} else {
return (locDateTime.year - year == 1) &&
month == 12 &&
locDateTime.month == 1 &&
day == 31 &&
locDateTime.day == 1;
}
}