diff --git a/src/redux/sagas/ao/schedule_recurring_ao.js b/src/redux/sagas/ao/schedule_recurring_ao.js index 83c20c831..dad35b098 100644 --- a/src/redux/sagas/ao/schedule_recurring_ao.js +++ b/src/redux/sagas/ao/schedule_recurring_ao.js @@ -14,7 +14,6 @@ import WSTypes from '../../constants/ws' const debug = Debug('hfui:recurring-ao') function* purgeSchedulerOnAlgoOrderChange({ gid, sagaToExecute }) { - console.log('before race') const { cancel } = yield race({ delay: sagaToExecute, cancel: take((action) => { diff --git a/src/util/date.js b/src/util/date.js index 442f75442..b9ec7d162 100644 --- a/src/util/date.js +++ b/src/util/date.js @@ -1,5 +1,5 @@ import { - isValid, format, startOfDay, addDays, + isValid, format, startOfDay, addDays, addMinutes, } from 'date-fns' import Debug from 'debug' import i18n, { DATE_FNS_LOCALES, LANGUAGES } from '../locales/i18n' @@ -66,6 +66,9 @@ export const roundDay = (firstDate, secondDate) => { const roundedFirstDateMs = startOfDay(firstDate).getTime() const secondDateMs = new Date(secondDate).getTime() - const daysDifference = Math.floor((secondDateMs - roundedFirstDateMs) / TIMEFRAME_WIDTHS['1D']) - return addDays(firstDate, daysDifference) + const daysDifference = Math.floor( + (secondDateMs - roundedFirstDateMs) / TIMEFRAME_WIDTHS['1D'], + ) + // add 15 minutes to the end time + return addMinutes(addDays(firstDate, daysDifference), 15) }