reduceDaysAndSetHHMM static method
Subtracts days from a reference date and sets the time to the specified HH:MM.
Parameters:
ref: Reference DateTimedays: Number of days to subtracthhColonMM: Time in "HH:MM" format
Returns a new DateTime with subtracted days and specified time (seconds and milliseconds set to 0).
Implementation
static DateTime reduceDaysAndSetHHMM(
DateTime ref, int days, String hhColonMM) {
var timeOfDay = parseHHColonMMToTimeOfDay(hhColonMM);
return ref.subtract(Duration(days: days)).copyWith(
hour: timeOfDay.hour,
minute: timeOfDay.minute,
second: 0,
millisecond: 0);
}