prevDay method
Returns the previous day.
This method calculates the day before the current DateTime object.
It handles month and year changes correctly.
isStartOfDay if true, returns the previous day at 00:00:00.
Implementation
@useResult
DateTime prevDay({bool isStartOfDay = true}) {
DateTime result = subtract(_oneDay);
if (isStartOfDay) {
result = DateTime(result.year, result.month, result.day);
}
return result;
}