Merge branch 'dev'

This commit is contained in:
Mo Tarbin
2026-03-15 23:48:29 -04:00
4 changed files with 31 additions and 20 deletions

View File

@@ -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 => ({

View File

@@ -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 = () => {
</FormControl>
{completionWindow !== -1 && (
<Box
sx={{
mt: 1,
ml: 4,
display: 'flex',
gap: 1,
alignItems: 'center',
}}
>
<DurationInput
value={completionWindow}
onChange={setCompletionWindow}
size='sm'
minValue={0}
/>
<Typography level='body-sm'>before due date</Typography>
</Box>
<Card variant='outlined'>
<Box
sx={{
mt: 0,
ml: 4,
}}
>
<Typography level='body-sm'>Hours:</Typography>
<Input
type='number'
value={completionWindow}
sx={{ maxWidth: 100 }}
slotProps={{
input: {
min: 0,
max: 24 * 7,
},
}}
placeholder='Hours'
onChange={e => {
setCompletionWindow(parseInt(e.target.value))
}}
/>
</Box>
</Card>
)}
{/* Expires After (Deadline) */}

View File

@@ -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')}
</Typography>
)}

View File

@@ -1276,6 +1276,9 @@ const MyChores = () => {
setSearchFilter('All')
setSearchTerm('')
clearActiveFilter()
// reset project and filters :
setSelectedProjectWithCache(null)
updateFilterUrl(null, null)
}}
variant='outlined'
color='neutral'