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