Open engyuhan opened 5 days ago
This is a duplicate issue
[The team marked this bug as a duplicate of the following bug]
Invalid february dates are treated as valid inputs
Steps to recreate:
- Add an appointment to a client with an invalid february date, e.g.
apt 3 d/30-02-01 fr/24:00 to/24:00
- Observe that the appointment is added with the largest february date e.g. 28-02-01 (as shown in screenshot 1 below), instead of the input being treated as invalid.
This does not happen for other months, in which dates like 32-03-01 are treated as invalid (see screenshot 2)
[original: nus-cs2103-AY2425S1/pe-interim#2320] [original labels: severity.Low type.FunctionalityBug]
[This is the team's response to the above 'original' bug]
Thanks for raising this issue.
Our team has actually tested this and realised this bug was cased by the date parsing or validation logic, which is likely using a lenient mode for date handling when processing February dates, allowing them to "roll over" to the nearest valid date instead of throwing an error. For other months, the validation behaves more strictly.
We understand that this bug can cause issues for a small handful of users and hence given the low severity, which our team agrees with as well.
We will address this issue in the upcoming iterations by ensuring stricter date validation and adding comprehensive unit tests to prevent discrepancies.
Items for the Tester to Verify
:question: Issue duplicate status
Team chose to mark this issue as a duplicate of another issue (as explained in the Team's response above)
Reason for disagreement: [replace this with your explanation]
Steps to Reproduce:
Expected: Error message: Invalid date
Actual: Appointment scheduled for Date: 28-02-25
Making a typo like this and not receiving any warning can lead to disastrous consequences.