fix: remove 7-day limit on sale date entry - #95
Merged
Conversation
Allow backdated sales by removing the frontend-only one-week validation and unused i18n strings. Future dates remain blocked via the date input max. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR removes the frontend-only restriction that prevented recording sales with dates more than 7 days in the past, while keeping the date picker constrained to not allow future dates.
Changes:
- Removed the “older than 1 week” sale date validation/alert from the sale form save flow.
- Deleted the now-unused
sales.dateCannotBeMoreThanWeekOldi18n strings from EN/ES locale files.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/components/pages/sales/SaleForm.tsx | Removes the 7-day “past date” guard so older sales can be saved. |
| src/i18n/locales/en.json | Removes unused sale-date validation message key. |
| src/i18n/locales/es.json | Removes unused sale-date validation message key. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Satisfies react-hooks/exhaustive-deps for save/remove purchase and sale callbacks. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sales.dateCannotBeMoreThanWeekOldstrings from EN/ES localesmax={today}on the sale date input so future dates are still blocked in the pickerTest plan
Made with Cursor