Added assumption when no time is supplied (#8855)

* Added assumption when no time is supplied

* Changed format of date

* Set now options when date is specified
This commit is contained in:
Keith Holliday
2017-07-07 19:46:54 -06:00
committed by Sabe Jones
parent b3f9fd09c6
commit 3fa0b72ffe
3 changed files with 45 additions and 4 deletions

View File

@@ -101,6 +101,7 @@ export function shouldDo (day, dailyTask, options = {}) {
}
let o = sanitizeOptions(options);
let startOfDayWithCDSTime = startOfDay(defaults({ now: day }, o));
// The time portion of the Start Date is never visible to or modifiable by the user so we must ignore it.
// Therefore, we must also ignore the time portion of the user's day start (startOfDayWithCDSTime), otherwise the date comparison will be wrong for some times.
// NB: The user's day start date has already been converted to the PREVIOUS day's date if the time portion was before CDS.