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/views/components/CustomParsers.js b/src/views/components/CustomParsers.js index 2983ba5..0a45e2d 100644 --- a/src/views/components/CustomParsers.js +++ b/src/views/components/CustomParsers.js @@ -722,8 +722,16 @@ export const parseDueDate = (inputSentence, chrono) => { .replace(/\s+/g, ' ') // Replace multiple spaces with single space .trim() + // If no specific time was mentioned, set to end of day (23:59:59) + // to indicate the date has no specific time tied to it (same convention as ChoreEdit) + let resultDate = dueDateMatch.start.date() + if (!dueDateMatch.start.isCertain('hour')) { + resultDate = new Date(resultDate) + resultDate.setHours(23, 59, 59, 0) + } + return { - result: dueDateMatch.start.date(), + result: resultDate, highlight: [ { text: fullHighlightText,