Skip to content

fix: handle day after tomorrow before tomorrow#995

Open
suhanimaurya05 wants to merge 1 commit into
Charushi06:mainfrom
suhanimaurya05:fix-day-after-tommorow
Open

fix: handle day after tomorrow before tomorrow#995
suhanimaurya05 wants to merge 1 commit into
Charushi06:mainfrom
suhanimaurya05:fix-day-after-tommorow

Conversation

@suhanimaurya05
Copy link
Copy Markdown

Related Issue

Closes #939

Summary

Fixed incorrect parsing of the phrase "day after tomorrow" in the client-side NLP date extractor. The extractor was matching "tomorrow" before checking the longer phrase, causing both expressions to resolve to the same date.

Changes Made

  • Reordered relative date matching in js/utils/nlpDateExtractor.js.
  • Checked day after tomorrow before tomorrow.
  • Aligned frontend fallback behavior with the server-side fallback parser.
  • Ensured day after tomorrow resolves to two days from the current date.

Testing

Tested locally by parsing:

  • Submit math homework tomorrow
  • Submit math homework day after tomorrow

Verified that:

  • tomorrow resolves to current date + 1 day.
  • day after tomorrow resolves to current date + 2 days.

Screenshots

N/A (No UI changes)

Checklist

  • Code follows project style
  • Tested locally
  • No unrelated changes included
  • Documentation updated (if applicable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Frontend NLP parses "day after tomorrow" as tomorrow

1 participant