diff --git a/src/utils/Chores.jsx b/src/utils/Chores.jsx index 6813603..f30df14 100644 --- a/src/utils/Chores.jsx +++ b/src/utils/Chores.jsx @@ -324,7 +324,7 @@ export const notInCompletionWindow = chore => { chore.completionWindow && chore.completionWindow > -1 && chore.nextDueDate && - moment() < moment(chore.nextDueDate).add(-chore.completionWindow, 'seconds') + moment() < moment(chore.nextDueDate).add(-chore.completionWindow, 'hours') ) } export const ChoreFilters = userId => ({ diff --git a/src/views/ChoreEdit/ChoreEdit.jsx b/src/views/ChoreEdit/ChoreEdit.jsx index 44425fa..35b9666 100644 --- a/src/views/ChoreEdit/ChoreEdit.jsx +++ b/src/views/ChoreEdit/ChoreEdit.jsx @@ -1189,7 +1189,7 @@ const ChoreEdit = () => { checked={completionWindow !== -1} onChange={e => { if (e.target.checked) { - setCompletionWindow(3600) // default 1 hour in seconds + setCompletionWindow(1) // default 1 hour in seconds } else { setCompletionWindow(-1) } @@ -1203,23 +1203,31 @@ const ChoreEdit = () => { {completionWindow !== -1 && ( - - - before due date - + + + Hours: + { + setCompletionWindow(parseInt(e.target.value)) + }} + /> + + )} {/* Expires After (Deadline) */} diff --git a/src/views/ChoreEdit/ChoreView.jsx b/src/views/ChoreEdit/ChoreView.jsx index d2f4993..a820d86 100644 --- a/src/views/ChoreEdit/ChoreView.jsx +++ b/src/views/ChoreEdit/ChoreView.jsx @@ -1071,7 +1071,7 @@ const ChoreView = () => { > Available to complete starting{' '} {moment(chore.nextDueDate) - .subtract(chore.completionWindow, 'seconds') + .subtract(chore.completionWindow, 'hours') .format('MM/DD/YYYY hh:mm A')} )}