diff --git a/src/utils/ChoreCardHelpers.jsx b/src/utils/ChoreCardHelpers.jsx index 013d5e5..2a09ccd 100644 --- a/src/utils/ChoreCardHelpers.jsx +++ b/src/utils/ChoreCardHelpers.jsx @@ -25,8 +25,8 @@ export const getDueDateChipText = (nextDueDate, chore) => { const dueDate = moment(nextDueDate) const diff = moment(nextDueDate).diff(moment(), 'hours') - // if seconds and minutes set to 59, treat as no time (date only) - if (dueDate.seconds() === 59 && dueDate.minutes() === 59) { + // if time is 23:59:59, treat as end-of-day (date only, no specific time) + if (dueDate.hours() === 23 && dueDate.minutes() === 59 && dueDate.seconds() === 59) { if (diff < 0) { // For overdue dates, show calendar format for recent dates const absDiff = Math.abs(diff) diff --git a/src/utils/Chores.jsx b/src/utils/Chores.jsx index 8ab7756..cde9fe7 100644 --- a/src/utils/Chores.jsx +++ b/src/utils/Chores.jsx @@ -16,6 +16,8 @@ export const ChoreHistoryStatus = Object.freeze({ SKIPPED: 2, PENDING_APPROVAL: 3, REJECTED: 4, + MISSED: 5, + RESCHEDULED: 6, }) export const ChoreStatus = Object.freeze({ INACTIVE: 0, diff --git a/src/views/ChoreEdit/ChoreEdit.jsx b/src/views/ChoreEdit/ChoreEdit.jsx index 35b9666..8dcf06b 100644 --- a/src/views/ChoreEdit/ChoreEdit.jsx +++ b/src/views/ChoreEdit/ChoreEdit.jsx @@ -1,18 +1,23 @@ -import { Add, HorizontalRule, Save } from '@mui/icons-material' +import { Add, ArrowDropDown, HorizontalRule, Save } from '@mui/icons-material' import { Avatar, Box, Button, + ButtonGroup, Card, Checkbox, Chip, Container, Divider, + Dropdown, FormControl, FormHelperText, + IconButton, Input, List, ListItem, + Menu, + MenuButton, MenuItem, Option, Radio, @@ -291,7 +296,7 @@ const ChoreEdit = () => { if (dueDateOnly) { const combinedDateTime = moment(`${dueDateOnly}T${defaultTime}`).format( - 'YYYY-MM-DDTHH:mm:00', + 'YYYY-MM-DDTHH:mm:59', ) setDueDate(combinedDateTime) @@ -309,7 +314,7 @@ const ChoreEdit = () => { if (dueDateOnly) { const endOfDay = moment(dueDateOnly) .endOf('day') - .format('YYYY-MM-DDTHH:mm:00') + .format('YYYY-MM-DDTHH:mm:ss') setDueDate(endOfDay) } } @@ -558,7 +563,7 @@ const ChoreEdit = () => { const today = moment(new Date()).format('YYYY-MM-DD') setDueDateOnly(today) // Default to end of day - setDueDate(moment(today).endOf('day').format('YYYY-MM-DDTHH:mm:00')) + setDueDate(moment(today).endOf('day').format('YYYY-MM-DDTHH:mm:59')) setUseCustomTime(false) setDueTime(null) } @@ -1107,7 +1112,7 @@ const ChoreEdit = () => { const today = moment(new Date()).format('YYYY-MM-DD') setDueDateOnly(today) setDueDate( - moment(today).endOf('day').format('YYYY-MM-DDTHH:mm:00'), + moment(today).endOf('day').format('YYYY-MM-DDTHH:mm:59'), ) setUseCustomTime(false) setDueTime(null) @@ -1638,39 +1643,38 @@ const ChoreEdit = () => { }} > {choreId > 0 && ( - <> - {isActive ? ( - - ) : ( - - )} - - + + + + + + + + Delete + + + )}